diff options
author | Alan Modra <amodra@gmail.com> | 2018-08-23 17:34:13 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-08-24 00:23:27 +0930 |
commit | 14732552e70bcb0c85093c404a7091627eea4e38 (patch) | |
tree | 5b7cae8c24f1780f7f534921e0afc3224048acbd | |
parent | 7dd36a6f1ca92cd4ca4776064c604cda7755bc44 (diff) | |
download | gdb-14732552e70bcb0c85093c404a7091627eea4e38.zip gdb-14732552e70bcb0c85093c404a7091627eea4e38.tar.gz gdb-14732552e70bcb0c85093c404a7091627eea4e38.tar.bz2 |
PowerPC64 st_other decoding in readelf
localentry:1 is a valid encoding, so display it. The patch also bails
out of get_ppc64_symbol_other when st_other bits besides the three
used for localentry offsets are set, to avoid hiding any such values.
* readelf.c (get_ppc64_symbol_other): Return NULL if st_other
field contains unrecognised or reserved values. Handle
localentry:1 value.
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/readelf.c | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 600f326..673bd90 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2018-08-23 Alan Modra <amodra@gmail.com> + + * readelf.c (get_ppc64_symbol_other): Return NULL if st_other + field contains unrecognised or reserved values. Handle + localentry:1 value. + 2018-08-23 H.J. Lu <hongjiu.lu@intel.com> PR ld/23536 diff --git a/binutils/readelf.c b/binutils/readelf.c index a936ff3..2d9d48d 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -11088,11 +11088,16 @@ get_ia64_symbol_other (Filedata * filedata, unsigned int other) static const char * get_ppc64_symbol_other (unsigned int other) { - if (PPC64_LOCAL_ENTRY_OFFSET (other) != 0) + if ((other & ~STO_PPC64_LOCAL_MASK) != 0) + return NULL; + + other >>= STO_PPC64_LOCAL_BIT; + if (other <= 6) { static char buf[32]; - snprintf (buf, sizeof buf, _("<localentry>: %d"), - PPC64_LOCAL_ENTRY_OFFSET (other)); + if (other >= 2) + other = ppc64_decode_local_entry (other); + snprintf (buf, sizeof buf, _("<localentry>: %d"), other); return buf; } return NULL; |