diff options
author | Alan Modra <amodra@gmail.com> | 2002-11-26 11:54:02 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-11-26 11:54:02 +0000 |
commit | 73722af036f2e6d2f6f8fa129dd627d99511ce37 (patch) | |
tree | 4d2d46fc88acacb8e558936e8d1e6a16342d8706 /bfd/elf-eh-frame.c | |
parent | fb2fd3e12c28c6faf4d048591793b9c1a5be1619 (diff) | |
download | gdb-73722af036f2e6d2f6f8fa129dd627d99511ce37.zip gdb-73722af036f2e6d2f6f8fa129dd627d99511ce37.tar.gz gdb-73722af036f2e6d2f6f8fa129dd627d99511ce37.tar.bz2 |
* elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
(_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs
on a relocatable link. Comment typos.
* elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure
in the order they are declared. Clear elf_hash_value too.
(_bfd_elf_link_hash_table_init): Likewise assign in order. Clear
eh_info and tls_segment.
* elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets
sorted when discarding relocs by turning them into R_*_NONE.
* libbfd.c (warn_deprecated): Comment spelling.
* po/SRC-POTFILES.in: Regenerate.
Diffstat (limited to 'bfd/elf-eh-frame.c')
-rw-r--r-- | bfd/elf-eh-frame.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index fa152ab..8938ecf 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -295,7 +295,8 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, #define ENSURE_NO_RELOCS(buf) \ if (cookie->rel < cookie->relend \ && (cookie->rel->r_offset \ - < (bfd_size_type) ((buf) - ehbuf))) \ + < (bfd_size_type) ((buf) - ehbuf)) \ + && cookie->rel->r_info != 0) \ goto free_no_table #define SKIP_RELOCS(buf) \ @@ -378,11 +379,12 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, /* CIE */ if (last_cie != NULL) { - /* Now check if this CIE is identical to last CIE, in which case - we can remove it, provided we adjust all FDEs. - Also, it can be removed if we have removed all FDEs using - that. */ - if (cie_compare (&cie, &hdr_info->last_cie) == 0 + /* Now check if this CIE is identical to the last CIE, + in which case we can remove it provided we adjust + all FDEs. Also, it can be removed if we have removed + all FDEs using it. */ + if ((!info->relocateable + && cie_compare (&cie, &hdr_info->last_cie) == 0) || cie_usage_count == 0) { new_size -= cie.hdr.length + 4; @@ -560,7 +562,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, goto free_no_table; if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie)) { - /* This is a FDE against discarded section, it should + /* This is a FDE against a discarded section. It should be deleted. */ new_size -= hdr.length + 4; sec_info->entry[sec_info->count].removed = 1; @@ -572,7 +574,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, && cie.make_relative == 0) || (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned)) { - /* If shared library uses absolute pointers + /* If a shared library uses absolute pointers which we cannot turn into PC relative, don't create the binary search table, since it is affected by runtime relocations. */ |