aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-01 19:29:43 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-01 19:29:43 +0000
commitd6f672b881f21e96280bfdaddb08002a220a0999 (patch)
treec080b1c6eb91148e532da3c8b8bc3cb208b77cc8 /bfd/elflink.h
parent0cb705689dfa2158883f11f34bbf1ede2523e51b (diff)
downloadgdb-d6f672b881f21e96280bfdaddb08002a220a0999.zip
gdb-d6f672b881f21e96280bfdaddb08002a220a0999.tar.gz
gdb-d6f672b881f21e96280bfdaddb08002a220a0999.tar.bz2
Fri Sep 1 15:18:50 1995 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>
* elflink.h (elf_bfd_final_link): Don't change a DT_INIT or DT_FINI entry if the appropriate symbol is not in the hash table. * libelf.h (struct elf_backend_data): Add create_program_headers and want_hdr_in_seg fields. * elfxx-target.h (elf_backend_want_hdr_in_seg): Define if not defined. (elf_backend_create_program_headers): Likewise. (elfNN_bed): Initialize create_program_headers and want_hdr_in_seg. * elf.c (get_program_header_size): Call create_program_headers backend routine. (map_program_segments): Check want_hdr_in_seg backend field. Call create_program_headers backend routine. * elf.c (assign_file_positions_except_relocs): Align non allocated sections when creating an executable. * elfcode.h (elf_swap_phdr_in): Make non static. (elf_swap_phdr_out): Make non static. * libelf.h (bfd_elf32_swap_phdr_in): Declare. (bfd_elf32_swap_phdr_out): Declare. (bfd_elf64_swap_phdr_in): Declare. (bfd_elf64_swap_phdr_out): Declare.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index ec12292..e1c22dd 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -2139,9 +2139,9 @@ elf_bfd_final_link (abfd, info)
h = elf_link_hash_lookup (elf_hash_table (info), name,
false, false, true);
- BFD_ASSERT (h != NULL);
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
+ if (h != NULL
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak))
{
dyn.d_un.d_val = h->root.u.def.value;
o = h->root.u.def.section;
@@ -2149,11 +2149,14 @@ elf_bfd_final_link (abfd, info)
dyn.d_un.d_val += (o->output_section->vma
+ o->output_offset);
else
- /* The symbol is imported from another shared
- library and does not apply to this one. */
- dyn.d_un.d_val = 0;
+ {
+ /* The symbol is imported from another shared
+ library and does not apply to this one. */
+ dyn.d_un.d_val = 0;
+ }
+
+ elf_swap_dyn_out (dynobj, &dyn, dyncon);
}
- elf_swap_dyn_out (dynobj, &dyn, dyncon);
}
break;