diff options
author | Alan Modra <amodra@gmail.com> | 2002-07-16 09:00:42 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-07-16 09:00:42 +0000 |
commit | c89583f83f25ee43b9c60220a81914d78a1e9916 (patch) | |
tree | 5697397573c3823fca82860b629738bd02f3790a /bfd/elflink.h | |
parent | 2cbb2eefe217fb5dc8eeabe1f192bfbbc4c7f0d7 (diff) | |
download | gdb-c89583f83f25ee43b9c60220a81914d78a1e9916.zip gdb-c89583f83f25ee43b9c60220a81914d78a1e9916.tar.gz gdb-c89583f83f25ee43b9c60220a81914d78a1e9916.tar.bz2 |
* elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
reloc section size is zero. Correct reloc output location.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 7fa2ccb..8d2e1e6 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -6945,7 +6945,7 @@ elf_link_input_bfd (finfo, input_bfd) Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; struct elf_link_hash_entry **rel_hash; - Elf_Internal_Shdr *input_rel_hdr; + Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2; unsigned int next_erel; boolean (*reloc_emitter) PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, @@ -7115,16 +7115,17 @@ elf_link_input_bfd (finfo, input_bfd) else reloc_emitter = elf_link_output_relocs; - if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr, - internal_relocs)) + if (input_rel_hdr->sh_size != 0 + && ! (*reloc_emitter) (output_bfd, o, input_rel_hdr, + internal_relocs)) return false; - input_rel_hdr = elf_section_data (o)->rel_hdr2; - if (input_rel_hdr) + input_rel_hdr2 = elf_section_data (o)->rel_hdr2; + if (input_rel_hdr2 && input_rel_hdr2->sh_size != 0) { internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr) * bed->s->int_rels_per_ext_rel); - if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr, + if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr2, internal_relocs)) return false; } |