aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/aarch64elf.em2
-rw-r--r--ld/emultempl/aix.em2
-rw-r--r--ld/emultempl/armcoff.em3
-rw-r--r--ld/emultempl/armelf.em5
-rw-r--r--ld/emultempl/cr16elf.em18
-rw-r--r--ld/emultempl/cskyelf.em4
-rw-r--r--ld/emultempl/m68hc1xelf.em6
-rw-r--r--ld/emultempl/m68kelf.em9
-rw-r--r--ld/emultempl/mipself.em2
-rw-r--r--ld/emultempl/mmix-elfnmmo.em4
-rw-r--r--ld/emultempl/mmo.em6
-rw-r--r--ld/emultempl/msp430.em20
-rw-r--r--ld/emultempl/nios2elf.em2
-rw-r--r--ld/emultempl/pe.em5
-rw-r--r--ld/emultempl/pep.em2
-rw-r--r--ld/emultempl/ppc64elf.em11
-rw-r--r--ld/emultempl/xtensaelf.em10
17 files changed, 52 insertions, 59 deletions
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index 7ffb17e..bd5c888 100644
--- a/ld/emultempl/aarch64elf.em
+++ b/ld/emultempl/aarch64elf.em
@@ -178,7 +178,7 @@ elf${ELFSIZE}_aarch64_add_stub_section (const char *stub_sec_name,
/* Long branch stubs contain a 64-bit address, so the section requires
8 byte alignment. */
- bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
+ bfd_set_section_alignment (stub_sec, 3);
output_section = input_section->output_section;
os = lang_output_section_get (output_section);
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index 8151a9d..1ce8376 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -895,7 +895,7 @@ gld${EMULATION_NAME}_before_allocation (void)
if (is == NULL)
{
einfo (_("%F%P: can't find %s in output section\n"),
- bfd_get_section_name (sec->owner, sec));
+ bfd_section_name (sec));
}
/* Now figure out where the section should go. */
diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em
index 20122aa..180e1fa 100644
--- a/ld/emultempl/armcoff.em
+++ b/ld/emultempl/armcoff.em
@@ -176,8 +176,7 @@ gld${EMULATION_NAME}_finish (void)
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
+ + bfd_section_vma (h->u.def.section->output_section)
+ h->u.def.section->output_offset);
val |= 1;
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index bb32bbb..0cbfcc7 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -232,7 +232,7 @@ elf32_arm_add_stub_section (const char * stub_sec_name,
if (stub_sec == NULL)
goto err_ret;
- bfd_set_section_alignment (stub_file->the_bfd, stub_sec, alignment_power);
+ bfd_set_section_alignment (stub_sec, alignment_power);
os = lang_output_section_get (output_section);
@@ -478,8 +478,7 @@ gld${EMULATION_NAME}_finish (void)
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
+ + bfd_section_vma (h->u.def.section->output_section)
+ h->u.def.section->output_offset);
val |= 1;
diff --git a/ld/emultempl/cr16elf.em b/ld/emultempl/cr16elf.em
index 197f0c6..9cdd356 100644
--- a/ld/emultempl/cr16elf.em
+++ b/ld/emultempl/cr16elf.em
@@ -75,14 +75,12 @@ cr16_elf_after_open (void)
relsec = bfd_make_section (abfd, ".emreloc");
if (relsec == NULL
- || ! bfd_set_section_flags (abfd, relsec,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY))
- || ! bfd_set_section_alignment (abfd, relsec, 2)
- || ! bfd_set_section_size (abfd, relsec,
- datasec->reloc_count * 8))
+ || !bfd_set_section_flags (relsec, (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY))
+ || !bfd_set_section_alignment (relsec, 2)
+ || !bfd_set_section_size (relsec, datasec->reloc_count * 8))
einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
}
@@ -99,11 +97,11 @@ cr16_elf_after_open (void)
static void
check_sections (bfd *abfd, asection *sec, void *datasec)
{
- if ((strncmp (bfd_get_section_name (abfd, sec), ".data.rel", 9) == 0)
+ if ((strncmp (bfd_section_name (sec), ".data.rel", 9) == 0)
&& sec != datasec
&& sec->reloc_count == 0 )
einfo (_("%X%P: %pB: section %s has relocs; can not use --embedded-relocs\n"),
- abfd, bfd_get_section_name (abfd, sec));
+ abfd, bfd_section_name (sec));
}
static void
diff --git a/ld/emultempl/cskyelf.em b/ld/emultempl/cskyelf.em
index 10d037c..9184808 100644
--- a/ld/emultempl/cskyelf.em
+++ b/ld/emultempl/cskyelf.em
@@ -180,10 +180,10 @@ elf32_csky_add_stub_section (const char *stub_sec_name,
if (stub_sec == NULL)
goto err_ret;
- bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
+ bfd_set_section_alignment (stub_sec, 3);
output_section = input_section->output_section;
- secname = bfd_get_section_name (output_section->owner, output_section);
+ secname = bfd_section_name (output_section);
os = lang_output_section_find (secname);
info.input_section = input_section;
diff --git a/ld/emultempl/m68hc1xelf.em b/ld/emultempl/m68hc1xelf.em
index b55989e..b63e4e9 100644
--- a/ld/emultempl/m68hc1xelf.em
+++ b/ld/emultempl/m68hc1xelf.em
@@ -212,10 +212,8 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
case lang_input_section_enum:
if (l->input_section.section == info->input_section
- || strcmp (bfd_get_section_name (l->input_section.section->owner,
- l->input_section.section),
- bfd_get_section_name (info->input_section->owner,
- info->input_section)) == 0)
+ || strcmp (bfd_section_name (l->input_section.section),
+ bfd_section_name (info->input_section)) == 0)
{
/* We've found our section. Insert the stub immediately
before its associated input section. */
diff --git a/ld/emultempl/m68kelf.em b/ld/emultempl/m68kelf.em
index add8fd2..c8d9eea 100644
--- a/ld/emultempl/m68kelf.em
+++ b/ld/emultempl/m68kelf.em
@@ -102,9 +102,8 @@ m68k_elf_after_open (void)
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY));
if (relsec == NULL
- || ! bfd_set_section_alignment (abfd, relsec, 2)
- || ! bfd_set_section_size (abfd, relsec,
- datasec->reloc_count * 12))
+ || !bfd_set_section_alignment (relsec, 2)
+ || !bfd_set_section_size (relsec, datasec->reloc_count * 12))
einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
}
@@ -123,11 +122,11 @@ m68k_elf_after_open (void)
static void
check_sections (bfd *abfd, asection *sec, void *datasec)
{
- if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
+ if ((bfd_section_flags (sec) & SEC_DATA)
&& sec != datasec
&& sec->reloc_count != 0)
einfo (_("%X%P: %pB: section %s has relocs; can not use --embedded-relocs\n"),
- abfd, bfd_get_section_name (abfd, sec));
+ abfd, bfd_section_name (sec));
}
#endif /* SUPPORT_EMBEDDED_RELOCS */
diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em
index 108d33f..48944d5 100644
--- a/ld/emultempl/mipself.em
+++ b/ld/emultempl/mipself.em
@@ -168,7 +168,7 @@ mips_add_stub_section (const char *stub_sec_name, asection *input_section,
/* Set the flags. */
flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
| SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_KEEP);
- if (!bfd_set_section_flags (stub_bfd, stub_sec, flags))
+ if (!bfd_set_section_flags (stub_sec, flags))
goto err_ret;
os = lang_output_section_get (output_section);
diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em
index 736988b..7cb4087 100644
--- a/ld/emultempl/mmix-elfnmmo.em
+++ b/ld/emultempl/mmix-elfnmmo.em
@@ -103,14 +103,14 @@ mmix_after_allocation (void)
}
/* Set vma to correspond to first such register number * 8. */
- bfd_set_section_vma (link_info.output_bfd, sec, (bfd_vma) regvma);
+ bfd_set_section_vma (sec, (bfd_vma) regvma);
/* Simplify symbol output for the register section (without contents;
created for register symbols) by setting the output offset to 0.
This section is only present when there are register symbols. */
sec = bfd_get_section_by_name (link_info.output_bfd, MMIX_REG_SECTION_NAME);
if (sec != NULL)
- bfd_set_section_vma (sec->owner, sec, 0);
+ bfd_set_section_vma (sec, 0);
if (!_bfd_mmix_after_linker_allocation (link_info.output_bfd, &link_info))
{
diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em
index 62ee144..fff4894 100644
--- a/ld/emultempl/mmo.em
+++ b/ld/emultempl/mmo.em
@@ -192,10 +192,10 @@ mmo_place_orphan (asection *s,
paper over the bug similarly. */
static void
-mmo_wipe_sec_reloc_flag (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
+mmo_wipe_sec_reloc_flag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
+ void *ptr ATTRIBUTE_UNUSED)
{
- bfd_set_section_flags (abfd, sec,
- bfd_get_section_flags (abfd, sec) & ~SEC_RELOC);
+ bfd_set_section_flags (sec, bfd_section_flags (sec) & ~SEC_RELOC);
}
/* Iterate with bfd_map_over_sections over mmo_wipe_sec_reloc_flag... */
diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em
index 765a9ea..8f25489 100644
--- a/ld/emultempl/msp430.em
+++ b/ld/emultempl/msp430.em
@@ -382,10 +382,10 @@ change_output_section (lang_statement_union_type ** head,
}
static void
-add_region_prefix (bfd *abfd, asection *s,
- ATTRIBUTE_UNUSED void *unused)
+add_region_prefix (bfd *abfd ATTRIBUTE_UNUSED, asection *s,
+ void *unused ATTRIBUTE_UNUSED)
{
- const char *curr_name = bfd_get_section_name (abfd, s);
+ const char *curr_name = bfd_section_name (s);
int region = REGION_NONE;
if (strncmp (curr_name, ".text", 5) == 0)
@@ -404,10 +404,10 @@ add_region_prefix (bfd *abfd, asection *s,
case REGION_NONE:
break;
case REGION_UPPER:
- bfd_rename_section (abfd, s, concat (".upper", curr_name, NULL));
+ bfd_rename_section (s, concat (".upper", curr_name, NULL));
break;
case REGION_LOWER:
- bfd_rename_section (abfd, s, concat (".lower", curr_name, NULL));
+ bfd_rename_section (s, concat (".lower", curr_name, NULL));
break;
case REGION_EITHER:
s->name = concat (".either", curr_name, NULL);
@@ -538,7 +538,8 @@ gld${EMULATION_NAME}_handle_option (int optc)
}
static void
-eval_upper_either_sections (bfd *abfd, asection *s, void *data)
+eval_upper_either_sections (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *s, void *data)
{
const char * base_sec_name;
const char * curr_name;
@@ -560,7 +561,7 @@ eval_upper_either_sections (bfd *abfd, asection *s, void *data)
return;
base_sec_name = (const char *) data;
- curr_name = bfd_get_section_name (abfd, s);
+ curr_name = bfd_section_name (s);
/* Only concerned with .either input sections in the upper output section. */
either_name = concat (".either", base_sec_name, NULL);
@@ -620,7 +621,8 @@ eval_upper_either_sections (bfd *abfd, asection *s, void *data)
}
static void
-eval_lower_either_sections (bfd *abfd, asection *s, void *data)
+eval_lower_either_sections (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *s, void *data)
{
const char * base_sec_name;
const char * curr_name;
@@ -640,7 +642,7 @@ eval_lower_either_sections (bfd *abfd, asection *s, void *data)
return;
base_sec_name = (const char *) data;
- curr_name = bfd_get_section_name (abfd, s);
+ curr_name = bfd_section_name (s);
/* Only concerned with .either input sections in the lower or "default"
output section i.e. not in the upper output section. */
diff --git a/ld/emultempl/nios2elf.em b/ld/emultempl/nios2elf.em
index 02eb06f..816da6c 100644
--- a/ld/emultempl/nios2elf.em
+++ b/ld/emultempl/nios2elf.em
@@ -181,7 +181,7 @@ nios2elf_add_stub_section (const char *stub_sec_name, asection *input_section,
goto err_ret;
output_section = input_section->output_section;
- secname = bfd_get_section_name (output_section->owner, output_section);
+ secname = bfd_section_name (output_section);
os = lang_output_section_find (secname);
info.input_section = input_section;
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 2e78f26..70f771c 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1920,8 +1920,7 @@ gld_${EMULATION_NAME}_finish (void)
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
+ + bfd_section_vma (h->u.def.section->output_section)
+ h->u.def.section->output_offset);
val |= 1;
@@ -2182,7 +2181,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
ls = &(*pl)->input_section;
- lname = bfd_get_section_name (ls->section->owner, ls->section);
+ lname = bfd_section_name (ls->section);
if (strchr (lname, '\$') != NULL
&& (dollar == NULL || strcmp (orig_secname, lname) < 0))
break;
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 601ef11..6d150d2 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -1979,7 +1979,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
ls = &(*pl)->input_section;
- lname = bfd_get_section_name (ls->section->owner, ls->section);
+ lname = bfd_section_name (ls->section);
if (strchr (lname, '\$') != NULL
&& (dollar == NULL || strcmp (orig_secname, lname) < 0))
break;
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index 6df2a20..ee71f25 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -421,12 +421,11 @@ ppc_add_stub_section (const char *stub_sec_name, asection *input_section)
stub_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd,
stub_sec_name, flags);
if (stub_sec == NULL
- || !bfd_set_section_alignment (stub_file->the_bfd, stub_sec,
- (params.plt_stub_align > 5
- ? params.plt_stub_align
- : params.plt_stub_align < -5
- ? -params.plt_stub_align
- : 5)))
+ || !bfd_set_section_alignment (stub_sec, (params.plt_stub_align > 5
+ ? params.plt_stub_align
+ : params.plt_stub_align < -5
+ ? -params.plt_stub_align
+ : 5)))
goto err_ret;
output_section = input_section->output_section;
diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
index c826363..569df61 100644
--- a/ld/emultempl/xtensaelf.em
+++ b/ld/emultempl/xtensaelf.em
@@ -127,9 +127,9 @@ replace_insn_sec_with_prop_sec (bfd *abfd,
/* Create a property table section for it. */
prop_sec_name = strdup (prop_sec_name);
prop_sec = bfd_make_section_with_flags
- (abfd, prop_sec_name, bfd_get_section_flags (abfd, insn_sec));
+ (abfd, prop_sec_name, bfd_section_flags (insn_sec));
if (prop_sec == NULL
- || ! bfd_set_section_alignment (abfd, prop_sec, 2))
+ || !bfd_set_section_alignment (prop_sec, 2))
{
*error_message = _("could not create new section");
goto cleanup;
@@ -247,7 +247,7 @@ replace_instruction_table_sections (bfd *abfd, asection *sec)
char *owned_prop_sec_name = NULL;
const char *sec_name;
- sec_name = bfd_get_section_name (abfd, sec);
+ sec_name = bfd_section_name (sec);
if (strcmp (sec_name, INSN_SEC_BASE_NAME) == 0)
{
insn_sec_name = INSN_SEC_BASE_NAME;
@@ -1293,10 +1293,10 @@ static bfd_boolean
is_inconsistent_linkonce_section (asection *sec)
{
bfd *abfd = sec->owner;
- const char *sec_name = bfd_get_section_name (abfd, sec);
+ const char *sec_name = bfd_section_name (sec);
const char *name;
- if ((bfd_get_section_flags (abfd, sec) & SEC_LINK_ONCE) == 0
+ if ((bfd_section_flags (sec) & SEC_LINK_ONCE) == 0
|| strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0)
return FALSE;