aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-09-18 16:25:19 +0930
committerAlan Modra <amodra@gmail.com>2019-09-18 23:07:31 +0930
commite6f7f6d14f7e1acba0cf41726616a270e7d3c121 (patch)
tree746d1bc8b1493f816181195a8d9ffaf3f4e1fa8e /bfd
parent2b44a6a237320a390284b1a8237a6bed67d5401f (diff)
downloadgdb-e6f7f6d14f7e1acba0cf41726616a270e7d3c121.zip
gdb-e6f7f6d14f7e1acba0cf41726616a270e7d3c121.tar.gz
gdb-e6f7f6d14f7e1acba0cf41726616a270e7d3c121.tar.bz2
bfd_asymbol_* macros
The main point of this patch is to give bfd_get_section a better name, bfd_asymbol_section. bfd/ * bfd-in.h (bfd_asymbol_section): Rename from bfd_get_section. (bfd_get_output_section): Delete. (bfd_asymbol_base): Delete. (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), (bfd_asymbol_bfd, bfd_asymbol_flavour): Tidy. (bfd_set_asymbol_name): New macro. * bfd-in2.h: Regenerate. * aout-cris.c: Update throughout to use bfd_asymbol_section. * aoutx.h: Likewise. * cofflink.c: Likewise. * dwarf2.c: Likewise. * ecoff.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-mips.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elfn32-mips.c: Likewise. * elfnn-aarch64.c: Likewise. * elfxx-mips.c: Likewise. * linker.c: Likewise. * pdp11.c: Likewise. * elf64-mmix.c (mmix_elf_reloc): Expand bfd_get_output_section. binutils/ * nm.c: Update bfd_get_section to bfd_asymbol_section throughout. * objcopy.c: Likewise. * objdump.c: Likewise. * rdcoff.c: Likewise. * objcopy.c (create_new_symbol): Use bfd_set_asymbol_name. (filter_symbols): Likewise. gas/ * symbols.c (S_IS_LOCAL): Update bfd_get_section to bfd_asymbol_section. gdb/ * arm-tdep.c (arm_record_special_symbol): Update bfd_get_section to bfd_asymbol_section. ld/ * ldcref.c (check_reloc_refs): Update bfd_get_section to bfd_asymbol_section.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog26
-rw-r--r--bfd/aout-cris.c4
-rw-r--r--bfd/aoutx.h6
-rw-r--r--bfd/bfd-in.h19
-rw-r--r--bfd/bfd-in2.h19
-rw-r--r--bfd/cofflink.c2
-rw-r--r--bfd/dwarf2.c10
-rw-r--r--bfd/ecoff.c4
-rw-r--r--bfd/elf.c4
-rw-r--r--bfd/elf32-arm.c2
-rw-r--r--bfd/elf32-mips.c4
-rw-r--r--bfd/elf32-score.c4
-rw-r--r--bfd/elf32-score7.c4
-rw-r--r--bfd/elf64-mmix.c2
-rw-r--r--bfd/elfn32-mips.c4
-rw-r--r--bfd/elfnn-aarch64.c2
-rw-r--r--bfd/elfxx-mips.c4
-rw-r--r--bfd/linker.c32
-rw-r--r--bfd/pdp11.c2
19 files changed, 87 insertions, 67 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 86ea499..63f6c4c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,29 @@
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * bfd-in.h (bfd_asymbol_section): Rename from bfd_get_section.
+ (bfd_get_output_section): Delete.
+ (bfd_asymbol_base): Delete.
+ (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name),
+ (bfd_asymbol_bfd, bfd_asymbol_flavour): Tidy.
+ (bfd_set_asymbol_name): New macro.
+ * bfd-in2.h: Regenerate.
+ * aout-cris.c: Update throughout to use bfd_asymbol_section.
+ * aoutx.h: Likewise.
+ * cofflink.c: Likewise.
+ * dwarf2.c: Likewise.
+ * ecoff.c: Likewise.
+ * elf.c: Likewise.
+ * elf32-arm.c: Likewise.
+ * elf32-mips.c: Likewise.
+ * elf32-score.c: Likewise.
+ * elf32-score7.c: Likewise.
+ * elfn32-mips.c: Likewise.
+ * elfnn-aarch64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * linker.c: Likewise.
+ * pdp11.c: Likewise.
+ * elf64-mmix.c (mmix_elf_reloc): Part expand bfd_get_output_section.
+
2019-09-18 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Re-generate.
diff --git a/bfd/aout-cris.c b/bfd/aout-cris.c
index feed5ed..31b0035 100644
--- a/bfd/aout-cris.c
+++ b/bfd/aout-cris.c
@@ -169,14 +169,14 @@ MY (swap_ext_reloc_out) (bfd *abfd,
from the abs section, or as a symbol which has an abs value.
check for that here. */
- if (bfd_is_abs_section (bfd_get_section (sym)))
+ if (bfd_is_abs_section (bfd_asymbol_section (sym)))
{
r_extern = 0;
r_index = N_ABS;
}
else if ((sym->flags & BSF_SECTION_SYM) == 0)
{
- if (bfd_is_und_section (bfd_get_section (sym))
+ if (bfd_is_und_section (bfd_asymbol_section (sym))
/* Remember to check for weak symbols; they count as global. */
|| (sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
r_extern = 1;
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index cd50b44..859153b 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -1570,7 +1570,7 @@ translate_to_native_sym_flags (bfd *abfd,
to another. */
sym_pointer->e_type[0] &= ~N_TYPE;
- sec = bfd_get_section (cache_ptr);
+ sec = bfd_asymbol_section (cache_ptr);
off = 0;
if (sec == NULL)
@@ -2064,14 +2064,14 @@ NAME (aout, swap_ext_reloc_out) (bfd *abfd,
Absolute symbols can come in in two ways, either as an offset
from the abs section, or as a symbol which has an abs value.
check for that here. */
- if (bfd_is_abs_section (bfd_get_section (sym)))
+ if (bfd_is_abs_section (bfd_asymbol_section (sym)))
{
r_extern = 0;
r_index = N_ABS;
}
else if ((sym->flags & BSF_SECTION_SYM) == 0)
{
- if (bfd_is_und_section (bfd_get_section (sym))
+ if (bfd_is_und_section (bfd_asymbol_section (sym))
|| (sym->flags & BSF_GLOBAL) != 0)
r_extern = 1;
else
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 6c72acb..5a30344 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -240,18 +240,15 @@ typedef unsigned long symindex;
/* General purpose part of a symbol X;
target specific parts are in libcoff.h, libaout.h, etc. */
-#define bfd_get_section(x) ((x)->section)
-#define bfd_get_output_section(x) ((x)->section->output_section)
-#define bfd_set_section(x,y) ((x)->section) = (y)
-#define bfd_asymbol_base(x) ((x)->section->vma)
-#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
-#define bfd_asymbol_name(x) ((x)->name)
-/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
-#define bfd_asymbol_bfd(x) ((x)->the_bfd)
-#define bfd_asymbol_flavour(x) \
- (((x)->flags & BSF_SYNTHETIC) != 0 \
+#define bfd_asymbol_section(sy) ((sy)->section)
+#define bfd_asymbol_value(sy) ((sy)->section->vma + (sy)->value)
+#define bfd_asymbol_name(sy) ((sy)->name)
+#define bfd_asymbol_bfd(sy) ((sy)->the_bfd)
+#define bfd_asymbol_flavour(sy) \
+ (((sy)->flags & BSF_SYNTHETIC) != 0 \
? bfd_target_unknown_flavour \
- : bfd_asymbol_bfd (x)->xvec->flavour)
+ : (sy)->the_bfd->xvec->flavour)
+#define bfd_set_asymbol_name(sy, n) do { (sy)->name = (n); } while (0)
/* A canonical archive symbol. */
/* This is a type pun with struct ranlib on purpose! */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index aec2143..6542d40 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -247,18 +247,15 @@ typedef unsigned long symindex;
/* General purpose part of a symbol X;
target specific parts are in libcoff.h, libaout.h, etc. */
-#define bfd_get_section(x) ((x)->section)
-#define bfd_get_output_section(x) ((x)->section->output_section)
-#define bfd_set_section(x,y) ((x)->section) = (y)
-#define bfd_asymbol_base(x) ((x)->section->vma)
-#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
-#define bfd_asymbol_name(x) ((x)->name)
-/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
-#define bfd_asymbol_bfd(x) ((x)->the_bfd)
-#define bfd_asymbol_flavour(x) \
- (((x)->flags & BSF_SYNTHETIC) != 0 \
+#define bfd_asymbol_section(sy) ((sy)->section)
+#define bfd_asymbol_value(sy) ((sy)->section->vma + (sy)->value)
+#define bfd_asymbol_name(sy) ((sy)->name)
+#define bfd_asymbol_bfd(sy) ((sy)->the_bfd)
+#define bfd_asymbol_flavour(sy) \
+ (((sy)->flags & BSF_SYNTHETIC) != 0 \
? bfd_target_unknown_flavour \
- : bfd_asymbol_bfd (x)->xvec->flavour)
+ : (sy)->the_bfd->xvec->flavour)
+#define bfd_set_asymbol_name(sy, n) do { (sy)->name = (n); } while (0)
/* A canonical archive symbol. */
/* This is a type pun with struct ranlib on purpose! */
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 34d68c9..7bcc1ca 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -902,7 +902,7 @@ _bfd_coff_final_link (bfd *abfd,
bfd_asymbol_name(sym), FALSE, FALSE)
== NULL))
|| (((flaginfo.info->discard == discard_sec_merge
- && (bfd_get_section (sym)->flags & SEC_MERGE)
+ && (bfd_asymbol_section (sym)->flags & SEC_MERGE)
&& ! bfd_link_relocatable (flaginfo.info))
|| flaginfo.info->discard == discard_l)
&& bfd_is_local_label_name (sub, bfd_asymbol_name(sym))))
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index ed6dcd4..575b082 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -2736,7 +2736,7 @@ lookup_symbol_in_function_table (struct comp_unit *unit,
bfd_vma best_fit_len = 0;
struct arange *arange;
const char *name = bfd_asymbol_name (sym);
- asection *sec = bfd_get_section (sym);
+ asection *sec = bfd_asymbol_section (sym);
for (each_func = unit->function_table;
each_func;
@@ -2784,7 +2784,7 @@ lookup_symbol_in_variable_table (struct comp_unit *unit,
unsigned int *linenumber_ptr)
{
const char *name = bfd_asymbol_name (sym);
- asection *sec = bfd_get_section (sym);
+ asection *sec = bfd_asymbol_section (sym);
struct varinfo* each;
for (each = unit->variable_table; each; each = each->prev_var)
@@ -4048,7 +4048,7 @@ info_hash_lookup_funcinfo (struct info_hash_table *hash_table,
struct info_list_node *node;
struct arange *arange;
const char *name = bfd_asymbol_name (sym);
- asection *sec = bfd_get_section (sym);
+ asection *sec = bfd_asymbol_section (sym);
for (node = lookup_info_hash_table (hash_table, name);
node;
@@ -4096,7 +4096,7 @@ info_hash_lookup_varinfo (struct info_hash_table *hash_table,
unsigned int *linenumber_ptr)
{
const char *name = bfd_asymbol_name (sym);
- asection *sec = bfd_get_section (sym);
+ asection *sec = bfd_asymbol_section (sym);
struct varinfo* each;
struct info_list_node *node;
@@ -4695,7 +4695,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
if (do_line)
{
BFD_ASSERT (section == NULL && offset == 0 && functionname_ptr == NULL);
- section = bfd_get_section (symbol);
+ section = bfd_asymbol_section (symbol);
addr = symbol->value;
}
else
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 1e6f4d2..c06fa5e 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -2312,7 +2312,7 @@ ecoff_get_extr (asymbol *sym, EXTR *esym)
symbol. */
if ((esym->asym.sc == scUndefined
|| esym->asym.sc == scSUndefined)
- && ! bfd_is_und_section (bfd_get_section (sym)))
+ && ! bfd_is_und_section (bfd_asymbol_section (sym)))
esym->asym.sc = scAbs;
/* Adjust the FDR index for the symbol by that used for the input
@@ -2719,7 +2719,7 @@ _bfd_ecoff_write_object_contents (bfd *abfd)
{ _RCONST, RELOC_SECTION_RCONST }
};
- name = bfd_get_section_name (abfd, bfd_get_section (sym));
+ name = bfd_get_section_name (abfd, bfd_asymbol_section (sym));
for (j = 0; j < ARRAY_SIZE (section_symndx); j++)
if (streq (name, section_symndx[j].name))
diff --git a/bfd/elf.c b/bfd/elf.c
index ecd348e..1a1eed9 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4057,8 +4057,8 @@ sym_is_global (bfd *abfd, asymbol *sym)
return (*bed->elf_backend_sym_is_global) (abfd, sym);
return ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE)) != 0
- || bfd_is_und_section (bfd_get_section (sym))
- || bfd_is_com_section (bfd_get_section (sym)));
+ || bfd_is_und_section (bfd_asymbol_section (sym))
+ || bfd_is_com_section (bfd_asymbol_section (sym)));
}
/* Filter global symbols of ABFD to include in the import library. All
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index b675fc6..e29a60a 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -16076,7 +16076,7 @@ arm_elf_find_function (bfd * abfd,
BFD_ARM_SPECIAL_SYM_TYPE_ANY))
continue;
/* Fall through. */
- if (bfd_get_section (&q->symbol) == section
+ if (bfd_asymbol_section (&q->symbol) == section
&& q->symbol.value >= low_func
&& q->symbol.value <= offset)
{
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 9f8f2bd..74300a1 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -2281,8 +2281,8 @@ mips_elf_sym_is_global (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym)
return (sym->flags & BSF_SECTION_SYM) == 0;
else
return ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE)) != 0
- || bfd_is_und_section (bfd_get_section (sym))
- || bfd_is_com_section (bfd_get_section (sym)));
+ || bfd_is_und_section (bfd_asymbol_section (sym))
+ || bfd_is_com_section (bfd_asymbol_section (sym)));
}
/* Set the right machine number for a MIPS ELF file. */
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index 6390309..1bbf64f 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -596,8 +596,8 @@ score_elf_got15_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
bfd *output_bfd, char **error_message)
{
if ((symbol->flags & (BSF_GLOBAL | BSF_WEAK)) != 0
- || bfd_is_und_section (bfd_get_section (symbol))
- || bfd_is_com_section (bfd_get_section (symbol)))
+ || bfd_is_und_section (bfd_asymbol_section (symbol))
+ || bfd_is_com_section (bfd_asymbol_section (symbol)))
/* The relocation is against a global symbol. */
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
input_section, output_bfd,
diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c
index ea0ccd0..51a5fb1 100644
--- a/bfd/elf32-score7.c
+++ b/bfd/elf32-score7.c
@@ -497,8 +497,8 @@ score_elf_got15_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
bfd *output_bfd, char **error_message)
{
if ((symbol->flags & (BSF_GLOBAL | BSF_WEAK)) != 0
- || bfd_is_und_section (bfd_get_section (symbol))
- || bfd_is_com_section (bfd_get_section (symbol)))
+ || bfd_is_und_section (bfd_asymbol_section (symbol))
+ || bfd_is_com_section (bfd_asymbol_section (symbol)))
/* The relocation is against a global symbol. */
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
input_section, output_bfd,
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 839bd45..18ed456 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1315,7 +1315,7 @@ mmix_elf_reloc (bfd *abfd,
else
relocation = symbol->value;
- reloc_target_output_section = bfd_get_output_section (symbol);
+ reloc_target_output_section = bfd_asymbol_section (symbol)->output_section;
/* Here the variable relocation holds the final address of the symbol we
are relocating against, plus any addend. */
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 58d66ce..8927e98 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -3841,8 +3841,8 @@ mips_elf_sym_is_global (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym)
return (sym->flags & BSF_SECTION_SYM) == 0;
else
return ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE)) != 0
- || bfd_is_und_section (bfd_get_section (sym))
- || bfd_is_com_section (bfd_get_section (sym)));
+ || bfd_is_und_section (bfd_asymbol_section (sym))
+ || bfd_is_com_section (bfd_asymbol_section (sym)));
}
/* Set the right machine number for a MIPS ELF file. */
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index fd44505..7132b6b 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -8042,7 +8042,7 @@ aarch64_elf_find_function (bfd * abfd,
(q->symbol.name, BFD_AARCH64_SPECIAL_SYM_TYPE_ANY)))
continue;
/* Fall through. */
- if (bfd_get_section (&q->symbol) == section
+ if (bfd_asymbol_section (&q->symbol) == section
&& q->symbol.value >= low_func && q->symbol.value <= offset)
{
func = (asymbol *) q;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index e305404..8ad5268 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -2531,8 +2531,8 @@ _bfd_mips_elf_got16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
bfd *output_bfd, char **error_message)
{
if ((symbol->flags & (BSF_GLOBAL | BSF_WEAK)) != 0
- || bfd_is_und_section (bfd_get_section (symbol))
- || bfd_is_com_section (bfd_get_section (symbol)))
+ || bfd_is_und_section (bfd_asymbol_section (symbol))
+ || bfd_is_com_section (bfd_asymbol_section (symbol)))
/* The relocation is against a global symbol. */
return _bfd_mips_elf_generic_reloc (abfd, reloc_entry, symbol, data,
input_section, output_bfd,
diff --git a/bfd/linker.c b/bfd/linker.c
index 8aec0d2..2518371 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -1163,9 +1163,9 @@ generic_link_add_symbol_list (bfd *abfd,
| BSF_GLOBAL
| BSF_CONSTRUCTOR
| BSF_WEAK)) != 0
- || bfd_is_und_section (bfd_get_section (p))
- || bfd_is_com_section (bfd_get_section (p))
- || bfd_is_ind_section (bfd_get_section (p)))
+ || bfd_is_und_section (bfd_asymbol_section (p))
+ || bfd_is_com_section (bfd_asymbol_section (p))
+ || bfd_is_ind_section (bfd_asymbol_section (p)))
{
const char *name;
const char *string;
@@ -1191,7 +1191,7 @@ generic_link_add_symbol_list (bfd *abfd,
bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, name, p->flags, bfd_get_section (p),
+ (info, abfd, name, p->flags, bfd_asymbol_section (p),
p->value, string, FALSE, FALSE, &bh)))
return FALSE;
h = (struct generic_link_hash_entry *) bh;
@@ -1218,15 +1218,15 @@ generic_link_add_symbol_list (bfd *abfd,
if (info->output_bfd->xvec == abfd->xvec)
{
if (h->sym == NULL
- || (! bfd_is_und_section (bfd_get_section (p))
- && (! bfd_is_com_section (bfd_get_section (p))
- || bfd_is_und_section (bfd_get_section (h->sym)))))
+ || (! bfd_is_und_section (bfd_asymbol_section (p))
+ && (! bfd_is_com_section (bfd_asymbol_section (p))
+ || bfd_is_und_section (bfd_asymbol_section (h->sym)))))
{
h->sym = p;
/* BSF_OLD_COMMON is a hack to support COFF reloc
reading, and it should go away when the COFF
linker is switched to the new version. */
- if (bfd_is_com_section (bfd_get_section (p)))
+ if (bfd_is_com_section (bfd_asymbol_section (p)))
p->flags |= BSF_OLD_COMMON;
}
}
@@ -2026,9 +2026,9 @@ _bfd_generic_link_output_symbols (bfd *output_bfd,
| BSF_GLOBAL
| BSF_CONSTRUCTOR
| BSF_WEAK)) != 0
- || bfd_is_und_section (bfd_get_section (sym))
- || bfd_is_com_section (bfd_get_section (sym))
- || bfd_is_ind_section (bfd_get_section (sym)))
+ || bfd_is_und_section (bfd_asymbol_section (sym))
+ || bfd_is_com_section (bfd_asymbol_section (sym))
+ || bfd_is_ind_section (bfd_asymbol_section (sym)))
{
if (sym->udata.p != NULL)
h = (struct generic_link_hash_entry *) sym->udata.p;
@@ -2044,7 +2044,7 @@ _bfd_generic_link_output_symbols (bfd *output_bfd,
the relocs in the output format being used. */
h = NULL;
}
- else if (bfd_is_und_section (bfd_get_section (sym)))
+ else if (bfd_is_und_section (bfd_asymbol_section (sym)))
h = ((struct generic_link_hash_entry *)
bfd_wrapped_link_hash_lookup (output_bfd, info,
bfd_asymbol_name (sym),
@@ -2601,15 +2601,15 @@ default_indirect_link_order (bfd *output_bfd,
| BSF_GLOBAL
| BSF_CONSTRUCTOR
| BSF_WEAK)) != 0
- || bfd_is_und_section (bfd_get_section (sym))
- || bfd_is_com_section (bfd_get_section (sym))
- || bfd_is_ind_section (bfd_get_section (sym)))
+ || bfd_is_und_section (bfd_asymbol_section (sym))
+ || bfd_is_com_section (bfd_asymbol_section (sym))
+ || bfd_is_ind_section (bfd_asymbol_section (sym)))
{
/* sym->udata may have been set by
generic_link_add_symbol_list. */
if (sym->udata.p != NULL)
h = (struct bfd_link_hash_entry *) sym->udata.p;
- else if (bfd_is_und_section (bfd_get_section (sym)))
+ else if (bfd_is_und_section (bfd_asymbol_section (sym)))
h = bfd_wrapped_link_hash_lookup (output_bfd, info,
bfd_asymbol_name (sym),
FALSE, FALSE, TRUE);
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index f7f3128..238f514 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -1352,7 +1352,7 @@ translate_to_native_sym_flags (bfd *abfd,
to another. */
sym_pointer->e_type[0] &= ~N_TYPE;
- sec = bfd_get_section (cache_ptr);
+ sec = bfd_asymbol_section (cache_ptr);
off = 0;
if (sec == NULL)