aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2005-02-11 16:41:09 +0000
committerPaul Brook <paul@codesourcery.com>2005-02-11 16:41:09 +0000
commit6768797874e44f9769fa081f50cb02e6e97dae6b (patch)
tree47a5480b51b5c389f50a60e47697d16deedc815f /bfd/elflink.c
parentbc18c937be1315894f181fa276fd6c221d205528 (diff)
downloadgdb-6768797874e44f9769fa081f50cb02e6e97dae6b.zip
gdb-6768797874e44f9769fa081f50cb02e6e97dae6b.tar.gz
gdb-6768797874e44f9769fa081f50cb02e6e97dae6b.tar.bz2
2005-02-11 Paul Brook <paul@codesourcery.com>
* elf-bfd.h (struct elf_link_hash_table): Add is_relocatable_executable. * elf.c (_bfd_elf_link_hash_table_init): Initialize it. * elflink.c (bfd_elf_link_record_dynamic_symbol): Create local dynamic symbols in relocatable executables. (bfd_elf_record_link_assignment): Create dynamic section symbols in relocatable executables. (_bfd_elf_link_renumber_dynsyms): Ditto. (bfd_elf_final_link): Ditto. * elf32-arm.c (elf32_arm_final_link_relocate): Copy absolute relocations into relocatable executables. (elf32_arm_check_relocs): Crate dynamic sections for relocatable executables. Also copy absolute relocations. (elf32_arm_adjust_dynamic_symbol): Don't create copy relocations in relocatable executables. (allocate_dynrelocs): Copy relocations for relocatable executables. Output dynamic symbols for symbols defined in linker scripts.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 4cbcc1b..16a368e 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -386,7 +386,8 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
&& h->root.type != bfd_link_hash_undefweak)
{
h->forced_local = 1;
- return TRUE;
+ if (!elf_hash_table (info)->is_relocatable_executable)
+ return TRUE;
}
default:
@@ -494,7 +495,8 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED,
if ((h->def_dynamic
|| h->ref_dynamic
- || info->shared)
+ || info->shared
+ || (info->executable && elf_hash_table (info)->is_relocatable_executable))
&& h->dynindx == -1)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
@@ -710,7 +712,7 @@ _bfd_elf_link_renumber_dynsyms (bfd *output_bfd, struct bfd_link_info *info)
{
unsigned long dynsymcount = 0;
- if (info->shared)
+ if (info->shared || elf_hash_table (info)->is_relocatable_executable)
{
const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
asection *p;
@@ -8167,7 +8169,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
long last_local = 0;
/* Write out the section symbols for the output sections. */
- if (info->shared)
+ if (info->shared || elf_hash_table (info)->is_relocatable_executable)
{
asection *s;