aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-hppa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-06-29 14:46:03 +0000
committerAlan Modra <amodra@gmail.com>2012-06-29 14:46:03 +0000
commit3d4d4302b99ee621e11ac8ef60ac9185da94654b (patch)
tree95c1467db42073fd90064c7ab2d32ff28c133138 /bfd/elf64-hppa.c
parentb6ba681cdacf16ce4369eb5e824c6bac2540f332 (diff)
downloadgdb-3d4d4302b99ee621e11ac8ef60ac9185da94654b.zip
gdb-3d4d4302b99ee621e11ac8ef60ac9185da94654b.tar.gz
gdb-3d4d4302b99ee621e11ac8ef60ac9185da94654b.tar.bz2
* section.c (bfd_get_linker_section): New function.
* elf32-arm.c: When retrieving SEC_LINKER_CREATED sections, use the above throughout rather than bfd_get_section_by_name. Use bfd_make_section_anyway rather than bfd_make_section when creating them. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cris.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68k.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-vax.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * elflink.c: Likewise. * elf-vxworks.c: Likewise. * elf-m10300.c: Likewise. Also make use of htab plt, got and gotplt shortcuts. * bfd-in2.h: Regenerate. * elf32-lm32.c (lm32_elf_check_relocs): Use the correct bfd when calling create_rofixup_section. * elflink.c (bfd_elf_final_link): Simplify test for .dynstr.
Diffstat (limited to 'bfd/elf64-hppa.c')
-rw-r--r--bfd/elf64-hppa.c118
1 files changed, 59 insertions, 59 deletions
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 6087fe5..62efef3 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -416,16 +416,16 @@ get_reloc_section (bfd *abfd,
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
- srel = bfd_get_section_by_name (dynobj, srel_name);
+ srel = bfd_get_linker_section (dynobj, srel_name);
if (srel == NULL)
{
- srel = bfd_make_section_with_flags (dynobj, srel_name,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY));
+ srel = bfd_make_section_anyway_with_flags (dynobj, srel_name,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY));
if (srel == NULL
|| !bfd_set_section_alignment (dynobj, srel, 3))
return FALSE;
@@ -1157,12 +1157,12 @@ get_opd (bfd *abfd,
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
- opd = bfd_make_section_with_flags (dynobj, ".opd",
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED));
+ opd = bfd_make_section_anyway_with_flags (dynobj, ".opd",
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED));
if (!opd
|| !bfd_set_section_alignment (abfd, opd, 3))
{
@@ -1193,12 +1193,12 @@ get_plt (bfd *abfd,
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
- plt = bfd_make_section_with_flags (dynobj, ".plt",
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED));
+ plt = bfd_make_section_anyway_with_flags (dynobj, ".plt",
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED));
if (!plt
|| !bfd_set_section_alignment (abfd, plt, 3))
{
@@ -1229,12 +1229,12 @@ get_dlt (bfd *abfd,
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
- dlt = bfd_make_section_with_flags (dynobj, ".dlt",
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED));
+ dlt = bfd_make_section_anyway_with_flags (dynobj, ".dlt",
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED));
if (!dlt
|| !bfd_set_section_alignment (abfd, dlt, 3))
{
@@ -1265,12 +1265,12 @@ get_stub (bfd *abfd,
if (!dynobj)
hppa_info->root.dynobj = dynobj = abfd;
- stub = bfd_make_section_with_flags (dynobj, ".stub",
- (SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_READONLY
- | SEC_LINKER_CREATED));
+ stub = bfd_make_section_anyway_with_flags (dynobj, ".stub",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED));
if (!stub
|| !bfd_set_section_alignment (abfd, stub, 3))
{
@@ -1345,45 +1345,45 @@ elf64_hppa_create_dynamic_sections (bfd *abfd,
if (! get_opd (abfd, info, hppa_info))
return FALSE;
- s = bfd_make_section_with_flags (abfd, ".rela.dlt",
- (SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_READONLY
- | SEC_LINKER_CREATED));
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.dlt",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED));
if (s == NULL
|| !bfd_set_section_alignment (abfd, s, 3))
return FALSE;
hppa_info->dlt_rel_sec = s;
- s = bfd_make_section_with_flags (abfd, ".rela.plt",
- (SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_READONLY
- | SEC_LINKER_CREATED));
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.plt",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED));
if (s == NULL
|| !bfd_set_section_alignment (abfd, s, 3))
return FALSE;
hppa_info->plt_rel_sec = s;
- s = bfd_make_section_with_flags (abfd, ".rela.data",
- (SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_READONLY
- | SEC_LINKER_CREATED));
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.data",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED));
if (s == NULL
|| !bfd_set_section_alignment (abfd, s, 3))
return FALSE;
hppa_info->other_rel_sec = s;
- s = bfd_make_section_with_flags (abfd, ".rela.opd",
- (SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_READONLY
- | SEC_LINKER_CREATED));
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.opd",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED));
if (s == NULL
|| !bfd_set_section_alignment (abfd, s, 3))
return FALSE;
@@ -1562,7 +1562,7 @@ elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
/* Set the contents of the .interp section to the interpreter. */
if (info->executable)
{
- sec = bfd_get_section_by_name (dynobj, ".interp");
+ sec = bfd_get_linker_section (dynobj, ".interp");
BFD_ASSERT (sec != NULL);
sec->size = sizeof ELF_DYNAMIC_INTERPRETER;
sec->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
@@ -1575,7 +1575,7 @@ elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
not actually use these entries. Reset the size of .rela.dlt,
which will cause it to get stripped from the output file
below. */
- sec = bfd_get_section_by_name (dynobj, ".rela.dlt");
+ sec = bfd_get_linker_section (dynobj, ".rela.dlt");
if (sec != NULL)
sec->size = 0;
}
@@ -2492,7 +2492,7 @@ elf64_hppa_finish_dynamic_sections (bfd *output_bfd,
elf64_hppa_finalize_dlt,
info);
- sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+ sdyn = bfd_get_linker_section (dynobj, ".dynamic");
if (elf_hash_table (info)->dynamic_sections_created)
{