aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-ia64.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/elfnn-ia64.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/elfnn-ia64.c')
-rw-r--r--bfd/elfnn-ia64.c77
1 files changed, 39 insertions, 38 deletions
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index fdefb03..d90b226 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -1552,12 +1552,12 @@ elfNN_ia64_create_dynamic_sections (bfd *abfd,
if (!get_pltoff (abfd, info, ia64_info))
return FALSE;
- s = bfd_make_section_with_flags (abfd, ".rela.IA_64.pltoff",
- (SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY));
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.IA_64.pltoff",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY));
if (s == NULL
|| !bfd_set_section_alignment (abfd, s, LOG_SECTION_ALIGN))
return FALSE;
@@ -1986,13 +1986,14 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
if (!dynobj)
ia64_info->root.dynobj = dynobj = abfd;
- fptr = bfd_make_section_with_flags (dynobj, ".opd",
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | (info->pie ? 0 : SEC_READONLY)
- | SEC_LINKER_CREATED));
+ fptr = bfd_make_section_anyway_with_flags (dynobj, ".opd",
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | (info->pie ? 0
+ : SEC_READONLY)
+ | SEC_LINKER_CREATED));
if (!fptr
|| !bfd_set_section_alignment (abfd, fptr, 4))
{
@@ -2005,12 +2006,12 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
if (info->pie)
{
asection *fptr_rel;
- fptr_rel = bfd_make_section_with_flags (dynobj, ".rela.opd",
- (SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY));
+ fptr_rel = bfd_make_section_anyway_with_flags (dynobj, ".rela.opd",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY));
if (fptr_rel == NULL
|| !bfd_set_section_alignment (abfd, fptr_rel,
LOG_SECTION_ALIGN))
@@ -2040,14 +2041,14 @@ get_pltoff (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED,
if (!dynobj)
ia64_info->root.dynobj = dynobj = abfd;
- pltoff = bfd_make_section_with_flags (dynobj,
- ELF_STRING_ia64_pltoff,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_SMALL_DATA
- | SEC_LINKER_CREATED));
+ pltoff = bfd_make_section_anyway_with_flags (dynobj,
+ ELF_STRING_ia64_pltoff,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_SMALL_DATA
+ | SEC_LINKER_CREATED));
if (!pltoff
|| !bfd_set_section_alignment (abfd, pltoff, 4))
{
@@ -2080,15 +2081,15 @@ get_reloc_section (bfd *abfd,
if (!dynobj)
ia64_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 && create)
{
- 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,
LOG_SECTION_ALIGN))
@@ -2988,7 +2989,7 @@ elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (ia64_info->root.dynamic_sections_created
&& info->executable)
{
- sec = bfd_get_section_by_name (dynobj, ".interp");
+ sec = bfd_get_linker_section (dynobj, ".interp");
BFD_ASSERT (sec != NULL);
sec->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
sec->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
@@ -3045,7 +3046,7 @@ elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* If we've got a .plt, we need some extra memory for the dynamic
linker. We stuff these in .got.plt. */
- sec = bfd_get_section_by_name (dynobj, ".got.plt");
+ sec = bfd_get_linker_section (dynobj, ".got.plt");
sec->size = 8 * PLT_RESERVED_WORDS;
}
@@ -4612,8 +4613,8 @@ elfNN_ia64_finish_dynamic_sections (bfd *abfd,
asection *sdyn, *sgotplt;
bfd_vma gp_val;
- sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
- sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
+ sdyn = bfd_get_linker_section (dynobj, ".dynamic");
+ sgotplt = bfd_get_linker_section (dynobj, ".got.plt");
BFD_ASSERT (sdyn != NULL);
dyncon = (ElfNN_External_Dyn *) sdyn->contents;
dynconend = (ElfNN_External_Dyn *) (sdyn->contents + sdyn->size);