diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-11-17 15:05:44 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-11-17 15:05:44 +0000 |
commit | 73a684473dcce81a3bd79a8be994e9b8dba8199e (patch) | |
tree | c80526c9b37ea99bd55428a83c9aeb535efd4063 /bfd | |
parent | aee7f7a306ae38c1ab7eb29f6a1eacafee9ff3f2 (diff) | |
download | gdb-73a684473dcce81a3bd79a8be994e9b8dba8199e.zip gdb-73a684473dcce81a3bd79a8be994e9b8dba8199e.tar.gz gdb-73a684473dcce81a3bd79a8be994e9b8dba8199e.tar.bz2 |
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create
DT_INIT and DT_FINI entries if the _init or _fini symbol is
defined or mentioned in a regular file.
PR 8462.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elflink.h | 15 |
2 files changed, 17 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ffadb6d..b71d6a5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +Fri Nov 17 10:02:58 1995 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create + DT_INIT and DT_FINI entries if the _init or _fini symbol is + defined or mentioned in a regular file. + Thu Nov 16 15:16:42 1995 Kim Knuttila <krk@cygnus.com> * coff-ppc.c (ppc_record_data_in_toc_entry): new function diff --git a/bfd/elflink.h b/bfd/elflink.h index 725aa93..37dd443 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -1345,6 +1345,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (elf_hash_table (info)->dynamic_sections_created) { struct elf_info_failed eif; + struct elf_link_hash_entry *h; bfd_size_type strsize; *sinterpptr = bfd_get_section_by_name (dynobj, ".interp"); @@ -1391,14 +1392,20 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, /* Add some entries to the .dynamic section. We fill in some of the values later, in elf_bfd_final_link, but we must add the entries now so that we know the final size of the .dynamic section. */ - if (elf_link_hash_lookup (elf_hash_table (info), "_init", false, - false, false) != NULL) + h = elf_link_hash_lookup (elf_hash_table (info), "_init", false, + false, false); + if (h != NULL + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) { if (! elf_add_dynamic_entry (info, DT_INIT, 0)) return false; } - if (elf_link_hash_lookup (elf_hash_table (info), "_fini", false, - false, false) != NULL) + h = elf_link_hash_lookup (elf_hash_table (info), "_fini", false, + false, false); + if (h != NULL + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) { if (! elf_add_dynamic_entry (info, DT_FINI, 0)) return false; |