summaryrefslogtreecommitdiff
path: root/bfd/elf64-alpha.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-08-15 15:39:08 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-08-15 15:39:08 +0000
commit6f09563afcfba46c790150b303ff7c16e2a3d676 (patch)
tree96e2eb824c9ba8f3f366979581ee28c24d14ef8f /bfd/elf64-alpha.c
parentf5cc34b7726f2222a3ad993f8023a63d21f933d1 (diff)
downloadbinutils-redhat-6f09563afcfba46c790150b303ff7c16e2a3d676.tar.gz
* elf-bfd.h (_bfd_elf_define_linkage_sym): Declare.
* elflink.c (_bfd_elf_define_linkage_sym): New function, extracted from.. (_bfd_elf_create_got_section): ..here. (_bfd_elf_link_create_dynamic_sections): Call it for _DYNAMIC. (_bfd_elf_create_dynamic_sections): ..and _PROCEDURE_LINKAGE_TABLE_. * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Use _bfd_elf_define_linkage_sym. * elf32-frv.c (_frv_create_got_section): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r--bfd/elf64-alpha.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 2868a02239..0472d7ff49 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -1232,7 +1232,6 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
asection *s;
flagword flags;
struct elf_link_hash_entry *h;
- struct bfd_link_hash_entry *bh;
/* We need to create .plt, .rela.plt, .got, and .rela.got sections. */
@@ -1245,17 +1244,8 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
.plt section. */
- bh = NULL;
- if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
- (bfd_vma) 0, (const char *) NULL, FALSE,
- get_elf_backend_data (abfd)->collect, &bh)))
- return FALSE;
- h = (struct elf_link_hash_entry *) bh;
- h->def_regular = 1;
- h->type = STT_OBJECT;
-
- if (info->shared && ! bfd_elf_link_record_dynamic_symbol (info, h))
+ if (!_bfd_elf_define_linkage_sym (abfd, info, s,
+ "_PROCEDURE_LINKAGE_TABLE_"))
return FALSE;
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
@@ -1292,21 +1282,11 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
dynobj's .got section. We don't do this in the linker script
because we don't want to define the symbol if we are not creating
a global offset table. */
- bh = NULL;
- if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL,
- alpha_elf_tdata(abfd)->got, (bfd_vma) 0, (const char *) NULL,
- FALSE, get_elf_backend_data (abfd)->collect, &bh)))
- return FALSE;
- h = (struct elf_link_hash_entry *) bh;
- h->def_regular = 1;
- h->type = STT_OBJECT;
-
- if (info->shared
- && ! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
-
+ h = _bfd_elf_define_linkage_sym (abfd, info, alpha_elf_tdata(abfd)->got,
+ "_GLOBAL_OFFSET_TABLE_");
elf_hash_table (info)->hgot = h;
+ if (h == NULL)
+ return FALSE;
return TRUE;
}