aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-11-26 11:54:02 +0000
committerAlan Modra <amodra@gmail.com>2002-11-26 11:54:02 +0000
commit73722af036f2e6d2f6f8fa129dd627d99511ce37 (patch)
tree4d2d46fc88acacb8e558936e8d1e6a16342d8706 /bfd/elflink.h
parentfb2fd3e12c28c6faf4d048591793b9c1a5be1619 (diff)
downloadgdb-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/elflink.h')
-rw-r--r--bfd/elflink.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index f784002..c945194 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