edd27c6 elf: Check for corrupt symbol version info

Authored and Committed by H.J. Lu 5 years ago
    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.
    
    (cherry picked from commit 7a815dd566f3dd32435ac73aa0a0cc948d525e06)
    
        
file modified
+6 -0
file modified
+1 -1
file modified
+6 -0
file modified
+9 -0