diff options
author | Alan Modra <amodra@bigpond.net.au> | 2002-09-23 10:52:03 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2002-09-23 10:52:03 +0000 |
commit | f0036f1c6181742c6076601bbdc8ce07d621d7df (patch) | |
tree | ae13c282e7a040b975278044bb4c4a7d03578199 /bfd | |
parent | acf54a045686e60018d7e025150b706f7069e787 (diff) | |
download | gdb-f0036f1c6181742c6076601bbdc8ce07d621d7df.tar.gz |
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs
for discarded FDEs. Remove redundant assignment.
* elflink.h (elf_bfd_discard_info): Save edited relocs.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf-eh-frame.c | 2 | ||||
-rw-r--r-- | bfd/elflink.h | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a3e243f2231..1f84b066019 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2002-09-23 Alan Modra <amodra@bigpond.net.au> + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs + for discarded FDEs. Remove redundant assignment. + * elflink.h (elf_bfd_discard_info): Save edited relocs. + 2002-09-22 H.J. Lu <hjl@gnu.org> * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index eb4a69b04d0..e80fc6c9d57 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -632,11 +632,11 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, goto free_no_table; if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie)) { - cookie->rel = rel; /* This is a FDE against discarded section, it should be deleted. */ new_size -= hdr.length + 4; sec_info->entry[sec_info->count].removed = 1; + memset (rel, 0, sizeof (*rel)); } else { diff --git a/bfd/elflink.h b/bfd/elflink.h index 2df334b1e48..85160e90257 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -8482,7 +8482,12 @@ elf_bfd_discard_info (output_bfd, info) if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, ehdr, elf_reloc_symbol_deleted_p, &cookie)) - ret = true; + { + /* Relocs have been edited. Ensure edited version is + used later in relocate_section. */ + elf_section_data (eh)->relocs = cookie.rels; + ret = true; + } if (cookie.rels && elf_section_data (eh)->relocs != cookie.rels) free (cookie.rels); } |