diff options
author | Alan Modra <amodra@gmail.com> | 2004-08-25 14:35:58 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2004-08-25 14:35:58 +0000 |
commit | f855931bbd914039754674f6f582a7236583f62b (patch) | |
tree | c9e5d655cbbebbb33fb1a58920c2045430a81981 /bfd/elf32-i386.c | |
parent | b18c562e39c5c3ee63032a9a0aa9b7571343fd58 (diff) | |
download | gdb-f855931bbd914039754674f6f582a7236583f62b.zip gdb-f855931bbd914039754674f6f582a7236583f62b.tar.gz gdb-f855931bbd914039754674f6f582a7236583f62b.tar.bz2 |
* elf32-i386.c (elf_i386_relocate_section): Zero section contents
for R_386_32 and R_386_PC32 relocs against symbols defined in
discarded sections.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 5eb34ab..855b985 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2319,8 +2319,19 @@ elf_i386_relocate_section (bfd *output_bfd, /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if (r_symndx == 0) + { + /* Zero the section contents. eh_frame generated by old + versions of gcc isn't edited by elf-eh-frame.c, so + FDEs for discarded linkonce functions might remain. + Putting zeros here will zero such FDE's address range. + This is a hint to unwinders and other consumers of + exception handling info that the FDE is invalid. */ + bfd_put_32 (input_bfd, 0, contents + rel->r_offset); + continue; + } + + if ((input_section->flags & SEC_ALLOC) == 0) break; if ((info->shared |