diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-08-25 06:17:52 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-08-25 06:18:06 -0700 |
commit | 7a815dd566f3dd32435ac73aa0a0cc948d525e06 (patch) | |
tree | 56d4e2e6724b24469ee4d1d657bc0a6470be3885 /bfd | |
parent | bbf6c6b8ca19efd7b0c9bf789bbafc1262a27517 (diff) | |
download | binutils-7a815dd566f3dd32435ac73aa0a0cc948d525e06.zip binutils-7a815dd566f3dd32435ac73aa0a0cc948d525e06.tar.gz binutils-7a815dd566f3dd32435ac73aa0a0cc948d525e06.tar.bz2 |
elf: Check for corrupt symbol version info
The BFD linker with PR ld/23499 may generate shared libraries with
corrupt symbol version info which leads to linker error when the
corrupt shared library is used:
/usr/bin/ld: bin/libKF5Service.so.5.49.0: _edata: invalid version 21 (max 0)
/usr/bin/ld: bin/libKF5Service.so.5.49.0: error adding symbols: bad value
Add check for corrupt symbol version info to objdump:
00000000000af005 g D .data 0000000000000000 <corrupt> _edata
and readelf:
728: 00000000000af005 0 NOTYPE GLOBAL DEFAULT 25 _edata@<corrupt> (5)
bfd/
PR ld/23499
* elf.c (_bfd_elf_get_symbol_version_string): Return
_("<corrupt>") for corrupt symbol version info.
binutils/
PR ld/23499
* readelf.c (get_symbol_version_string): Return _("<corrupt>")
for corrupt symbol version info.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c9e7e2a..3af19d5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2018-08-25 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/23499 + * elf.c (_bfd_elf_get_symbol_version_string): Return + _("<corrupt>") for corrupt symbol version info. + 2018-08-24 H.J. Lu <hongjiu.lu@intel.com> * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Handle @@ -1877,7 +1877,7 @@ _bfd_elf_get_symbol_version_string (bfd *abfd, asymbol *symbol, { Elf_Internal_Verneed *t; - version_string = ""; + version_string = _("<corrupt>"); for (t = elf_tdata (abfd)->verref; t != NULL; t = t->vn_nextref) |