diff options
author | Martin Liska <mliska@suse.cz> | 2020-10-05 18:03:08 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-10-06 16:07:02 +0200 |
commit | 190c04ba36d9c6c3dce41f12012aa97c6d7f22f5 (patch) | |
tree | 5ae616d53d3231f9a73afd4a03b0a1494cc0dc5d /gcc/memory-block.h | |
parent | a9a88a0a55e131172960fe56013965a7ab4eaf96 (diff) | |
download | gcc-190c04ba36d9c6c3dce41f12012aa97c6d7f22f5.zip gcc-190c04ba36d9c6c3dce41f12012aa97c6d7f22f5.tar.gz gcc-190c04ba36d9c6c3dce41f12012aa97c6d7f22f5.tar.bz2 |
lto: fix LTO debug sections copying.
readelf -S prints:
There are 81999 section headers, starting at offset 0x1f488060:
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[ 0] NULL 0000000000000000 000000 01404f 00 81998 0 0
[ 1] .group GROUP 0000000000000000 000040 000008 04 81995 105027 4
...
[81995] .symtab SYMTAB 0000000000000000 d5d9298 2db310 18 81997 105026 8
[81996] .symtab_shndx SYMTAB SECTION INDICES 0000000000000000 d8b45a8 079dd8 04 81995 0 4
[81997] .strtab STRTAB 0000000000000000 d92e380 80460c 00 0 0 1
...
Looking at the documentation:
Table 7–15 ELF sh_link and sh_info Interpretation
sh_type - sh_link
SHT_SYMTAB - The section header index of the associated string table.
SHT_SYMTAB_SHNDX - The section header index of the associated symbol table.
As seen, sh_link of a SHT_SYMTAB always points to a .strtab and readelf
confirms that.
So we need to use reverse mapping taken from
[81996] .symtab_shndx SYMTAB SECTION INDICES 0000000000000000 d8b45a8 079dd8 04 81995 0 4
where sh_link points to 81995.
libiberty/ChangeLog:
PR lto/97290
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Use sh_link of a .symtab_shndx section.
Diffstat (limited to 'gcc/memory-block.h')
0 files changed, 0 insertions, 0 deletions