diff options
author | Alan Modra <amodra@bigpond.net.au> | 2002-11-26 11:54:02 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2002-11-26 11:54:02 +0000 |
commit | c8958d238a6d326a4de9ee3a4127ebded80727c7 (patch) | |
tree | f4ad342d9ded41a7adc2b7ff9dbc2603b6844956 /bfd/elflink.h | |
parent | f47da1808e9f972f4fe9fbb13d3b7148e16e5cca (diff) | |
download | gdb-c8958d238a6d326a4de9ee3a4127ebded80727c7.tar.gz |
* 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/elflink.h')
-rw-r--r-- | bfd/elflink.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index f784002b021..c9451947828 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -6946,6 +6946,7 @@ elf_link_input_bfd (finfo, input_bfd) { Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; + bfd_vma last_offset; struct elf_link_hash_entry **rel_hash; Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2; unsigned int next_erel; @@ -6966,6 +6967,9 @@ elf_link_input_bfd (finfo, input_bfd) rel_hash = (elf_section_data (o->output_section)->rel_hashes + elf_section_data (o->output_section)->rel_count + elf_section_data (o->output_section)->rel_count2); + last_offset = o->output_offset; + if (!finfo->info->relocateable) + last_offset += o->output_section->vma; for (next_erel = 0; irela < irelaend; irela++, next_erel++) { unsigned long r_symndx; @@ -6983,8 +6987,14 @@ elf_link_input_bfd (finfo, input_bfd) irela->r_offset); if (irela->r_offset >= (bfd_vma) -2) { - /* This is a reloc for a deleted entry or somesuch. */ - memset (irela, 0, sizeof (*irela)); + /* This is a reloc for a deleted entry or somesuch. + Turn it into an R_*_NONE reloc, at the same + offset as the last reloc. elf_eh_frame.c and + elf_bfd_discard_info rely on reloc offsets + being ordered. */ + irela->r_offset = last_offset; + irela->r_info = 0; + irela->r_addend = 0; continue; } @@ -6994,9 +7004,10 @@ elf_link_input_bfd (finfo, input_bfd) if (!finfo->info->relocateable) irela->r_offset += o->output_section->vma; - r_symndx = ELF_R_SYM (irela->r_info); + last_offset = irela->r_offset; - if (r_symndx == 0) + r_symndx = ELF_R_SYM (irela->r_info); + if (r_symndx == STN_UNDEF) continue; if (r_symndx >= locsymcount |