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.
This commit is contained in:
Alan Modra
2019-09-18 16:25:19 +09:30
parent 2b44a6a237
commit e6f7f6d14f
30 changed files with 143 additions and 99 deletions

View File

@@ -592,8 +592,8 @@ numeric_forward (const void *P_x, const void *P_y)
if (x == NULL || y == NULL)
bfd_fatal (bfd_get_filename (sort_bfd));
xs = bfd_get_section (x);
ys = bfd_get_section (y);
xs = bfd_asymbol_section (x);
ys = bfd_asymbol_section (y);
if (bfd_is_und_section (xs))
{
@@ -645,8 +645,8 @@ size_forward1 (const void *P_x, const void *P_y)
if (x == NULL || y == NULL)
bfd_fatal (bfd_get_filename (sort_bfd));
xs = bfd_get_section (x);
ys = bfd_get_section (y);
xs = bfd_asymbol_section (x);
ys = bfd_asymbol_section (y);
if (bfd_is_und_section (xs))
abort ();
@@ -774,7 +774,7 @@ sort_symbols_by_size (bfd *abfd, bfd_boolean is_dynamic, void *minisyms,
else
next = NULL;
sec = bfd_get_section (sym);
sec = bfd_asymbol_section (sym);
/* Synthetic symbols don't have a full type set of data available, thus
we can't rely on that information for the symbol size. Ditto for
@@ -788,7 +788,7 @@ sort_symbols_by_size (bfd *abfd, bfd_boolean is_dynamic, void *minisyms,
else
{
if (from + size < fromend
&& sec == bfd_get_section (next))
&& sec == bfd_asymbol_section (next))
sz = valueof (next) - valueof (sym);
else
sz = (bfd_get_section_vma (abfd, sec)
@@ -895,7 +895,7 @@ print_symbol (bfd * abfd,
if ((sym->flags & (BSF_SECTION_SYM | BSF_SYNTHETIC)) == 0)
version_string = bfd_get_symbol_version_string (abfd, sym, &hidden);
if (bfd_is_und_section (bfd_get_section (sym)))
if (bfd_is_und_section (bfd_asymbol_section (sym)))
hidden = TRUE;
if (version_string && *version_string != '\0')
@@ -931,7 +931,7 @@ print_symbol (bfd * abfd,
lineno_cache_bfd = abfd;
}
if (bfd_is_und_section (bfd_get_section (sym)))
if (bfd_is_und_section (bfd_asymbol_section (sym)))
{
static asection **secs;
static arelent ***relocs;
@@ -1001,10 +1001,10 @@ print_symbol (bfd * abfd,
}
}
}
else if (bfd_get_section (sym)->owner == abfd)
else if (bfd_asymbol_section (sym)->owner == abfd)
{
if ((bfd_find_line (abfd, syms, sym, &filename, &lineno)
|| bfd_find_nearest_line (abfd, bfd_get_section (sym),
|| bfd_find_nearest_line (abfd, bfd_asymbol_section (sym),
syms, sym->value, &filename,
&functionname, &lineno))
&& filename != NULL