diff options
author | Tommi Rantala <tt.rantala@gmail.com> | 2012-09-19 11:01:01 +0300 |
---|---|---|
committer | Tommi Rantala <tt.rantala@gmail.com> | 2012-09-28 14:50:03 +0300 |
commit | a9b5b10f23fe0f55e39fece22d5d4bfdf7f3bdfe (patch) | |
tree | 29c49bcb883fb7ba1cc21f109acdb253bd2949bf | |
parent | fca254a9b4a96de9a5f3519f736dd01585b9a648 (diff) | |
download | libunwind-a9b5b10f23fe0f55e39fece22d5d4bfdf7f3bdfe.tar.gz |
Set `_UPT_reg_offset' read only
We do not modify `_UPT_reg_offset', so let's set it `const'. Given that
the array is exported, it's technically possible that some library user
is actually modifying the content, but does not seem really all that
likely.
-rw-r--r-- | src/ptrace/_UPT_internal.h | 2 | ||||
-rw-r--r-- | src/ptrace/_UPT_reg_offset.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/ptrace/_UPT_internal.h b/src/ptrace/_UPT_internal.h index 27149d36..2283dc41 100644 --- a/src/ptrace/_UPT_internal.h +++ b/src/ptrace/_UPT_internal.h @@ -54,6 +54,6 @@ struct UPT_info struct elf_dyn_info edi; }; -extern int _UPT_reg_offset[UNW_REG_LAST + 1]; +extern const int _UPT_reg_offset[UNW_REG_LAST + 1]; #endif /* _UPT_internal_h */ diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c index a59c852b..765f7d56 100644 --- a/src/ptrace/_UPT_reg_offset.c +++ b/src/ptrace/_UPT_reg_offset.c @@ -31,7 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # include <asm/ptrace_offsets.h> #endif -int _UPT_reg_offset[UNW_REG_LAST + 1] = +const int _UPT_reg_offset[UNW_REG_LAST + 1] = { #ifdef HAVE_ASM_PTRACE_OFFSETS_H # ifndef PT_AR_CSD |