This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] bfd_section_* macros
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org, gdb-cvs at sourceware dot org
- Date: 19 Sep 2019 00:25:13 -0000
- Subject: [binutils-gdb] bfd_section_* macros
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fd3619828e94a24a92cddec42cbc0ab33352eeb4
commit fd3619828e94a24a92cddec42cbc0ab33352eeb4
Author: Alan Modra <amodra@gmail.com>
Date: Mon Sep 16 20:25:17 2019 +0930
bfd_section_* macros
This large patch removes the unnecessary bfd parameter from various
bfd section macros and functions. The bfd is hardly ever used and if
needed for the bfd_set_section_* or bfd_rename_section functions can
be found via section->owner except for the com, und, abs, and ind
std_section special sections. Those sections shouldn't be modified
anyway.
The patch also removes various bfd_get_section_<field> macros,
replacing their use with bfd_section_<field>, and adds
bfd_set_section_lma. I've also fixed a minor bug in gas where
compressed section renaming was done directly rather than calling
bfd_rename_section. This would have broken bfd_get_section_by_name
and similar functions, but that hardly mattered at such a late stage
in gas processing.
bfd/
* bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
(bfd_get_section_lma, bfd_get_section_alignment),
(bfd_get_section_size, bfd_get_section_flags),
(bfd_get_section_userdata): Delete.
(bfd_section_name, bfd_section_size, bfd_section_vma),
(bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
(bfd_section_flags, bfd_section_userdata): New.
(bfd_is_com_section): Rename parameter.
* section.c (bfd_set_section_userdata, bfd_set_section_vma),
(bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
(bfd_set_section_size): Delete bfd parameter, rename section parameter.
(bfd_set_section_lma): New.
* bfd-in2.h: Regenerate.
* mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
update callers.
* aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
* elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
* elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
* elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
* elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
* elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
* elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
* elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
* elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
* elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
* elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
* mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
* peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
* xcofflink.c: Update throughout for bfd section macro and function
changes.
binutils/
* addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c,
* objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c,
* od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c,
* resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update
throughout for bfd section macro and function changes.
gas/
* as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c,
* read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c,
* config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c,
* config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c,
* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
* config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c,
* config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c,
* config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c,
* config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c,
* config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c,
* config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c,
* config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c,
* config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c,
* config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c,
* config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c,
* config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c,
* config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c,
* config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c,
* config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c,
* config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c,
* config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c,
* config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c,
* config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for
bfd section macro and function changes.
* write.c (compress_debug): Use bfd_rename_section.
gdb/
* aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
* coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c,
* dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c,
* exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h,
* hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c,
* i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c,
* maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c,
* mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c,
* objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c,
* ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c,
* rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c,
* s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c,
* solib-spu.c, * solib-svr4.c, * solib-target.c,
* spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c,
* symmisc.c, * symtab.c, * target.c, * windows-nat.c,
* xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c,
* mi/mi-interp.c: Update throughout for bfd section macro and
function changes.
* gcore (gcore_create_callback): Use bfd_set_section_lma.
* spu-tdep.c (spu_overlay_new_objfile): Likewise.
gprof/
* corefile.c, * symtab.c: Update throughout for bfd section
macro and function changes.
ld/
* ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c,
* emultempl/aarch64elf.em, * emultempl/aix.em,
* emultempl/armcoff.em, * emultempl/armelf.em,
* emultempl/cr16elf.em, * emultempl/cskyelf.em,
* emultempl/m68hc1xelf.em, * emultempl/m68kelf.em,
* emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
* emultempl/mmo.em, * emultempl/msp430.em,
* emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
* emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update
throughout for bfd section macro and function changes.
libctf/
* ctf-open-bfd.c: Update throughout for bfd section macro changes.
opcodes/
* arc-ext.c: Update throughout for bfd section macro changes.
sim/
* common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c,
* erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c,
* m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c,
* rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c,
* rx/trace.c: Update throughout for bfd section macro changes.
Diff:
---
bfd/ChangeLog | 45 ++++++++++++++
bfd/aoutx.h | 30 +++++-----
bfd/bfd-in.h | 24 +++-----
bfd/bfd-in2.h | 55 +++++++++--------
bfd/bfd.c | 8 +--
bfd/coff-alpha.c | 7 +--
bfd/coff-arm.c | 4 +-
bfd/coff-mips.c | 5 +-
bfd/coff64-rs6000.c | 4 +-
bfd/coffcode.h | 19 +++---
bfd/coffgen.c | 6 +-
bfd/cofflink.c | 3 +-
bfd/compress.c | 7 +--
bfd/ecoff.c | 20 +++----
bfd/elf-eh-frame.c | 4 +-
bfd/elf-hppa.h | 2 +-
bfd/elf-ifunc.c | 11 ++--
bfd/elf-m10200.c | 2 +-
bfd/elf-m10300.c | 17 +++---
bfd/elf-properties.c | 6 +-
bfd/elf-s390-common.c | 11 ++--
bfd/elf-vxworks.c | 6 +-
bfd/elf.c | 20 +++----
bfd/elf32-arc.c | 2 +-
bfd/elf32-arm.c | 27 ++++-----
bfd/elf32-avr.c | 24 ++++----
bfd/elf32-bfin.c | 38 ++++++------
bfd/elf32-cr16.c | 15 +++--
bfd/elf32-cr16c.c | 6 +-
bfd/elf32-cris.c | 6 +-
bfd/elf32-crx.c | 2 +-
bfd/elf32-csky.c | 4 +-
bfd/elf32-d10v.c | 2 +-
bfd/elf32-epiphany.c | 2 +-
bfd/elf32-fr30.c | 2 +-
bfd/elf32-frv.c | 30 +++++-----
bfd/elf32-ft32.c | 2 +-
bfd/elf32-h8300.c | 2 +-
bfd/elf32-hppa.c | 12 ++--
bfd/elf32-i386.c | 4 +-
bfd/elf32-ip2k.c | 2 +-
bfd/elf32-iq2000.c | 2 +-
bfd/elf32-lm32.c | 21 ++++---
bfd/elf32-m32c.c | 4 +-
bfd/elf32-m32r.c | 16 ++---
bfd/elf32-m68hc1x.c | 4 +-
bfd/elf32-m68k.c | 6 +-
bfd/elf32-mcore.c | 2 +-
bfd/elf32-mep.c | 2 +-
bfd/elf32-metag.c | 4 +-
bfd/elf32-microblaze.c | 12 ++--
bfd/elf32-moxie.c | 2 +-
bfd/elf32-msp430.c | 4 +-
bfd/elf32-mt.c | 2 +-
bfd/elf32-nds32.c | 43 +++++++-------
bfd/elf32-nios2.c | 16 ++---
bfd/elf32-or1k.c | 7 +--
bfd/elf32-ppc.c | 49 ++++++++--------
bfd/elf32-pru.c | 2 +-
bfd/elf32-rl78.c | 4 +-
bfd/elf32-rx.c | 2 +-
bfd/elf32-s390.c | 4 +-
bfd/elf32-score.c | 23 ++++----
bfd/elf32-score7.c | 23 ++++----
bfd/elf32-sh.c | 18 +++---
bfd/elf32-spu.c | 24 ++++----
bfd/elf32-tic6x.c | 18 +++---
bfd/elf32-tilepro.c | 9 ++-
bfd/elf32-v850.c | 31 +++++-----
bfd/elf32-vax.c | 7 +--
bfd/elf32-visium.c | 2 +-
bfd/elf32-xstormy16.c | 4 +-
bfd/elf32-xtensa.c | 16 ++---
bfd/elf64-alpha.c | 25 ++++----
bfd/elf64-bpf.c | 2 +-
bfd/elf64-hppa.c | 25 ++++----
bfd/elf64-ia64-vms.c | 40 ++++++-------
bfd/elf64-mmix.c | 30 +++++-----
bfd/elf64-ppc.c | 24 ++++----
bfd/elf64-s390.c | 4 +-
bfd/elf64-sparc.c | 2 +-
bfd/elf64-x86-64.c | 2 +-
bfd/elflink.c | 51 ++++++++--------
bfd/elfnn-aarch64.c | 13 ++---
bfd/elfnn-ia64.c | 29 +++++----
bfd/elfnn-riscv.c | 11 ++--
bfd/elfxx-aarch64.c | 8 +--
bfd/elfxx-mips.c | 81 ++++++++++++-------------
bfd/elfxx-sparc.c | 10 ++--
bfd/elfxx-tilegx.c | 9 ++-
bfd/elfxx-x86.c | 31 +++++-----
bfd/i386msdos.c | 14 ++---
bfd/linker.c | 4 +-
bfd/mach-o.c | 31 +++++-----
bfd/mmo.c | 80 ++++++++++++-------------
bfd/opncls.c | 14 ++---
bfd/pdp11.c | 16 +++--
bfd/pei-x86_64.c | 2 +-
bfd/peicode.h | 6 +-
bfd/reloc.c | 3 +-
bfd/section.c | 55 ++++++++---------
bfd/syms.c | 2 +-
bfd/vms-alpha.c | 20 +++----
bfd/xcofflink.c | 6 +-
binutils/ChangeLog | 8 +++
binutils/addr2line.c | 10 ++--
binutils/bucomm.c | 2 +-
binutils/coffgrok.c | 2 +-
binutils/dlltool.c | 16 +++--
binutils/nm.c | 4 +-
binutils/objcopy.c | 119 ++++++++++++++++++-------------------
binutils/objdump.c | 43 +++++++-------
binutils/od-elf32_avr.c | 26 ++++-----
binutils/od-macho.c | 2 +-
binutils/od-xcoff.c | 12 ++--
binutils/prdbg.c | 6 +-
binutils/rdcoff.c | 2 +-
binutils/rddbg.c | 4 +-
binutils/rescoff.c | 8 +--
binutils/resres.c | 2 +-
binutils/size.c | 18 +++---
binutils/srconv.c | 6 +-
binutils/strings.c | 2 +-
binutils/windmc.c | 2 +-
gas/ChangeLog | 28 +++++++++
gas/as.c | 8 +--
gas/as.h | 2 +-
gas/config/obj-coff-seh.c | 16 ++---
gas/config/obj-coff.c | 30 +++++-----
gas/config/obj-ecoff.c | 8 +--
gas/config/obj-elf.c | 27 ++++-----
gas/config/obj-macho.c | 16 ++---
gas/config/obj-som.c | 10 ++--
gas/config/tc-aarch64.c | 2 +-
gas/config/tc-alpha.c | 19 +++---
gas/config/tc-arc.c | 5 +-
gas/config/tc-arm.c | 9 ++-
gas/config/tc-avr.c | 6 +-
gas/config/tc-bfin.c | 2 +-
gas/config/tc-bpf.c | 2 +-
gas/config/tc-d10v.c | 2 +-
gas/config/tc-d30v.c | 4 +-
gas/config/tc-epiphany.c | 2 +-
gas/config/tc-fr30.c | 2 +-
gas/config/tc-frv.c | 4 +-
gas/config/tc-h8300.c | 2 +-
gas/config/tc-hppa.c | 28 +++++----
gas/config/tc-i386.c | 9 ++-
gas/config/tc-ia64.c | 23 +++-----
gas/config/tc-ip2k.c | 2 +-
gas/config/tc-iq2000.c | 6 +-
gas/config/tc-lm32.c | 2 +-
gas/config/tc-m32c.c | 2 +-
gas/config/tc-m32r.c | 4 +-
gas/config/tc-m68hc11.c | 2 +-
gas/config/tc-mep.c | 14 ++---
gas/config/tc-microblaze.c | 3 +-
gas/config/tc-mips.c | 51 ++++++++--------
gas/config/tc-mmix.c | 17 +++---
gas/config/tc-mn10200.c | 2 +-
gas/config/tc-mn10300.c | 4 +-
gas/config/tc-msp430.c | 2 +-
gas/config/tc-mt.c | 2 +-
gas/config/tc-nds32.c | 6 +-
gas/config/tc-or1k.c | 2 +-
gas/config/tc-ppc.c | 74 ++++++++++-------------
gas/config/tc-pru.c | 2 +-
gas/config/tc-rl78.c | 2 +-
gas/config/tc-rx.c | 4 +-
gas/config/tc-s12z.c | 2 +-
gas/config/tc-s390.c | 2 +-
gas/config/tc-score.c | 33 ++++++-----
gas/config/tc-score7.c | 20 +++----
gas/config/tc-sh.c | 4 +-
gas/config/tc-sparc.c | 2 +-
gas/config/tc-spu.c | 2 +-
gas/config/tc-tic4x.c | 6 +-
gas/config/tc-tic54x.c | 10 ++--
gas/config/tc-tic6x.c | 4 +-
gas/config/tc-tilegx.c | 6 +-
gas/config/tc-tilepro.c | 6 +-
gas/config/tc-v850.c | 8 +--
gas/config/tc-visium.c | 2 +-
gas/config/tc-wasm32.c | 2 +-
gas/config/tc-xc16x.c | 2 +-
gas/config/tc-xgate.c | 2 +-
gas/config/tc-xstormy16.c | 2 +-
gas/config/tc-xtensa.c | 22 +++----
gas/config/tc-z8k.c | 2 +-
gas/dw2gencfi.c | 16 ++---
gas/dwarf2dbg.c | 23 +++-----
gas/ecoff.c | 9 +--
gas/read.c | 12 ++--
gas/stabs.c | 4 +-
gas/subsegs.c | 10 ++--
gas/subsegs.h | 2 +-
gas/write.c | 44 +++++++-------
gdb/ChangeLog | 23 ++++++++
gdb/aarch64-linux-tdep.c | 2 +-
gdb/arm-tdep.c | 17 +++---
gdb/auto-load.c | 4 +-
gdb/cli/cli-dump.c | 20 +++----
gdb/coff-pe-read.c | 2 +-
gdb/coffread.c | 12 ++--
gdb/compile/compile-object-load.c | 49 ++++++++--------
gdb/corelow.c | 17 +++---
gdb/dbxread.c | 30 +++++-----
gdb/dicos-tdep.c | 2 +-
gdb/dwarf2-frame.c | 2 +-
gdb/dwarf2read.c | 120 +++++++++++++++++++-------------------
gdb/elfread.c | 24 ++++----
gdb/exec.c | 34 +++++------
gdb/fbsd-tdep.c | 12 ++--
gdb/gcore.c | 46 +++++++--------
gdb/gdb_bfd.c | 15 +++--
gdb/gdb_bfd.h | 2 +-
gdb/hppa-tdep.c | 6 +-
gdb/i386-cygwin-tdep.c | 8 +--
gdb/i386-fbsd-tdep.c | 2 +-
gdb/i386-linux-tdep.c | 2 +-
gdb/jit.c | 6 +-
gdb/linux-tdep.c | 2 +-
gdb/machoread.c | 5 +-
gdb/maint.c | 12 ++--
gdb/mdebugread.c | 2 +-
gdb/mi/mi-interp.c | 3 +-
gdb/minidebug.c | 2 +-
gdb/mips-linux-tdep.c | 2 +-
gdb/mips-sde-tdep.c | 2 +-
gdb/mips-tdep.c | 4 +-
gdb/mipsread.c | 8 +--
gdb/nto-tdep.c | 4 +-
gdb/objfiles.c | 12 ++--
gdb/objfiles.h | 6 +-
gdb/osabi.c | 6 +-
gdb/ppc-linux-tdep.c | 4 +-
gdb/ppc64-tdep.c | 4 +-
gdb/record-btrace.c | 3 +-
gdb/record-full.c | 11 ++--
gdb/remote.c | 13 ++---
gdb/rs6000-aix-tdep.c | 2 +-
gdb/rs6000-tdep.c | 2 +-
gdb/s390-linux-tdep.c | 2 +-
gdb/s390-tdep.c | 4 +-
gdb/solib-aix.c | 31 +++++-----
gdb/solib-dsbt.c | 20 +++----
gdb/solib-frv.c | 14 ++---
gdb/solib-spu.c | 2 +-
gdb/solib-svr4.c | 59 +++++++++----------
gdb/solib-target.c | 8 +--
gdb/spu-linux-nat.c | 2 +-
gdb/spu-tdep.c | 6 +-
gdb/symfile-mem.c | 6 +-
gdb/symfile.c | 119 ++++++++++++++++++-------------------
gdb/symmisc.c | 15 ++---
gdb/symtab.c | 15 ++---
gdb/target.c | 4 +-
gdb/windows-nat.c | 3 +-
gdb/xcoffread.c | 13 ++---
gprof/ChangeLog | 5 ++
gprof/corefile.c | 14 ++---
gprof/symtab.c | 2 +-
ld/ChangeLog | 13 +++++
ld/emultempl/aarch64elf.em | 2 +-
ld/emultempl/aix.em | 2 +-
ld/emultempl/armcoff.em | 3 +-
ld/emultempl/armelf.em | 5 +-
ld/emultempl/cr16elf.em | 18 +++---
ld/emultempl/cskyelf.em | 4 +-
ld/emultempl/m68hc1xelf.em | 6 +-
ld/emultempl/m68kelf.em | 9 ++-
ld/emultempl/mipself.em | 2 +-
ld/emultempl/mmix-elfnmmo.em | 4 +-
ld/emultempl/mmo.em | 6 +-
ld/emultempl/msp430.em | 20 ++++---
ld/emultempl/nios2elf.em | 2 +-
ld/emultempl/pe.em | 5 +-
ld/emultempl/pep.em | 2 +-
ld/emultempl/ppc64elf.em | 11 ++--
ld/emultempl/xtensaelf.em | 10 ++--
ld/ldcref.c | 6 +-
ld/ldctor.c | 2 +-
ld/ldelf.c | 6 +-
ld/ldlang.c | 51 +++++++---------
ld/pe-dll.c | 76 ++++++++++++------------
libctf/ChangeLog | 4 ++
libctf/ctf-open-bfd.c | 6 +-
opcodes/ChangeLog | 4 ++
opcodes/arc-ext.c | 2 +-
sim/ChangeLog | 8 +++
sim/common/sim-load.c | 8 +--
sim/common/sim-utils.c | 6 +-
sim/cris/sim-if.c | 18 +++---
sim/erc32/func.c | 10 ++--
sim/lm32/sim-if.c | 15 ++---
sim/m32c/load.c | 12 ++--
sim/m32c/trace.c | 2 +-
sim/m68hc11/interp.c | 6 +-
sim/ppc/hw_htab.c | 44 +++++++-------
sim/ppc/hw_init.c | 28 ++++-----
sim/rl78/load.c | 2 +-
sim/rl78/trace.c | 2 +-
sim/rx/gdb-if.c | 4 +-
sim/rx/load.c | 2 +-
sim/rx/trace.c | 2 +-
305 files changed, 1917 insertions(+), 1996 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 63f6c4c..8fff6a6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,50 @@
2019-09-18 Alan Modra <amodra@gmail.com>
+ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
+ (bfd_get_section_lma, bfd_get_section_alignment),
+ (bfd_get_section_size, bfd_get_section_flags),
+ (bfd_get_section_userdata): Delete.
+ (bfd_section_name, bfd_section_size, bfd_section_vma),
+ (bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
+ (bfd_section_flags, bfd_section_userdata): New.
+ (bfd_is_com_section): Rename parameter.
+ * section.c (bfd_set_section_userdata, bfd_set_section_vma),
+ (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
+ (bfd_set_section_size): Delete bfd parameter, rename section parameter.
+ (bfd_set_section_lma): New.
+ * bfd-in2.h: Regenerate.
+ * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
+ update callers.
+ * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
+ * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
+ * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
+ * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
+ * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
+ * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
+ * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
+ * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
+ * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
+ * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
+ * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
+ * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
+ * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
+ * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
+ * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
+ * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
+ * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
+ * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
+ * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
+ * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
+ * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
+ * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
+ * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
+ * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
+ * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
+ * xcofflink.c: Update throughout for bfd section macro and function
+ changes.
+
+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.
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 859153b..8923ca7 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -3108,18 +3108,18 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
break;
case N_TEXT | N_EXT:
section = obj_textsec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_DATA | N_EXT:
case N_SETV | N_EXT:
/* Treat N_SETV symbols as N_DATA symbol; see comment in
translate_from_native_sym_flags. */
section = obj_datasec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_BSS | N_EXT:
section = obj_bsssec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_INDR | N_EXT:
/* An indirect symbol. The next symbol is the symbol
@@ -3145,17 +3145,17 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
case N_SETT: case N_SETT | N_EXT:
section = obj_textsec (abfd);
flags |= BSF_CONSTRUCTOR;
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_SETD: case N_SETD | N_EXT:
section = obj_datasec (abfd);
flags |= BSF_CONSTRUCTOR;
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_SETB: case N_SETB | N_EXT:
section = obj_bsssec (abfd);
flags |= BSF_CONSTRUCTOR;
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_WARNING:
/* A warning symbol. The next symbol is the one to warn
@@ -3181,17 +3181,17 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
break;
case N_WEAKT:
section = obj_textsec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
flags = BSF_WEAK;
break;
case N_WEAKD:
section = obj_datasec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
flags = BSF_WEAK;
break;
case N_WEAKB:
section = obj_bsssec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
flags = BSF_WEAK;
break;
}
@@ -3899,8 +3899,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL,
(p->type == bfd_section_reloc_link_order
- ? bfd_section_name (flaginfo->output_bfd,
- pr->u.section)
+ ? bfd_section_name (pr->u.section)
: pr->u.name),
howto->name, pr->addend, NULL, NULL, (bfd_vma) 0);
break;
@@ -4314,7 +4313,7 @@ aout_link_input_section_std (struct aout_final_link_info *flaginfo,
asection *s;
s = aout_reloc_index_to_section (input_bfd, r_index);
- name = bfd_section_name (input_bfd, s);
+ name = bfd_section_name (s);
}
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name, howto->name,
@@ -4728,7 +4727,7 @@ aout_link_input_section_ext (struct aout_final_link_info *flaginfo,
asection *s;
s = aout_reloc_index_to_section (input_bfd, r_index);
- name = bfd_section_name (input_bfd, s);
+ name = bfd_section_name (s);
}
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name,
@@ -4868,8 +4867,7 @@ aout_link_write_symbols (struct aout_final_link_info *flaginfo, bfd *input_bfd)
return FALSE;
PUT_WORD (output_bfd, strtab_index, outsym->e_strx);
PUT_WORD (output_bfd,
- (bfd_get_section_vma (output_bfd,
- obj_textsec (input_bfd)->output_section)
+ (bfd_section_vma (obj_textsec (input_bfd)->output_section)
+ obj_textsec (input_bfd)->output_offset),
outsym->e_value);
++obj_aout_external_sym_count (output_bfd);
@@ -5077,7 +5075,7 @@ aout_link_write_symbols (struct aout_final_link_info *flaginfo, bfd *input_bfd)
BFD_ASSERT (bfd_is_abs_section (output_section)
|| output_section->owner == output_bfd);
val = (hresolve->root.u.def.value
- + bfd_get_section_vma (output_bfd, output_section)
+ + bfd_section_vma (output_section)
+ input_section->output_offset);
/* Get the correct type based on the section. If
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 5a30344..e55e3e9 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -299,21 +299,15 @@ typedef struct bfd_section *sec_ptr;
? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
: ~ (bfd_vma) 0)
-#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
-#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
-#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
-#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
- (ptr)->alignment_power)
-#define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) ((ptr)->size)
-#define bfd_get_section_size(ptr) ((ptr)->size)
-#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
-#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
-#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
-#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
-#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
-
-#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+#define bfd_section_name(sec) ((sec)->name)
+#define bfd_section_size(sec) ((sec)->size)
+#define bfd_section_vma(sec) ((sec)->vma)
+#define bfd_section_lma(sec) ((sec)->lma)
+#define bfd_section_alignment(sec) ((sec)->alignment_power)
+#define bfd_section_flags(sec) ((sec)->flags)
+#define bfd_section_userdata(sec) ((sec)->userdata)
+
+#define bfd_is_com_section(sec) (((sec)->flags & SEC_IS_COMMON) != 0)
#define bfd_get_section_limit_octets(bfd, sec) \
((bfd)->direction != write_direction && (sec)->rawsize != 0 \
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 6542d40..425f0c6 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -306,21 +306,15 @@ typedef struct bfd_section *sec_ptr;
? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
: ~ (bfd_vma) 0)
-#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
-#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
-#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
-#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
- (ptr)->alignment_power)
-#define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) ((ptr)->size)
-#define bfd_get_section_size(ptr) ((ptr)->size)
-#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
-#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
-#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
-#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
-#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
-
-#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+#define bfd_section_name(sec) ((sec)->name)
+#define bfd_section_size(sec) ((sec)->size)
+#define bfd_section_vma(sec) ((sec)->vma)
+#define bfd_section_lma(sec) ((sec)->lma)
+#define bfd_section_alignment(sec) ((sec)->alignment_power)
+#define bfd_section_flags(sec) ((sec)->flags)
+#define bfd_section_userdata(sec) ((sec)->userdata)
+
+#define bfd_is_com_section(sec) (((sec)->flags & SEC_IS_COMMON) != 0)
#define bfd_get_section_limit_octets(bfd, sec) \
((bfd)->direction != write_direction && (sec)->rawsize != 0 \
@@ -1742,26 +1736,31 @@ struct relax_table {
would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
compilers will complain about comma expressions that have no effect. */
static inline bfd_boolean
-bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
- void * val)
+bfd_set_section_userdata (asection *sec, void *val)
+{
+ sec->userdata = val;
+ return TRUE;
+}
+
+static inline bfd_boolean
+bfd_set_section_vma (asection *sec, bfd_vma val)
{
- ptr->userdata = val;
+ sec->vma = sec->lma = val;
+ sec->user_set_vma = TRUE;
return TRUE;
}
static inline bfd_boolean
-bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+bfd_set_section_lma (asection *sec, bfd_vma val)
{
- ptr->vma = ptr->lma = val;
- ptr->user_set_vma = TRUE;
+ sec->lma = val;
return TRUE;
}
static inline bfd_boolean
-bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
- unsigned int val)
+bfd_set_section_alignment (asection *sec, unsigned int val)
{
- ptr->alignment_power = val;
+ sec->alignment_power = val;
return TRUE;
}
@@ -1963,11 +1962,10 @@ asection *bfd_make_section_with_flags
asection *bfd_make_section (bfd *, const char *name);
-bfd_boolean bfd_set_section_flags
- (bfd *abfd, asection *sec, flagword flags);
+bfd_boolean bfd_set_section_flags (asection *sec, flagword flags);
void bfd_rename_section
- (bfd *abfd, asection *sec, const char *newname);
+ (asection *sec, const char *newname);
void bfd_map_over_sections
(bfd *abfd,
@@ -1979,8 +1977,7 @@ asection *bfd_sections_find_if
bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
void *obj);
-bfd_boolean bfd_set_section_size
- (bfd *abfd, asection *sec, bfd_size_type val);
+bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val);
bfd_boolean bfd_set_section_contents
(bfd *abfd, asection *section, const void *data,
diff --git a/bfd/bfd.c b/bfd/bfd.c
index c973c78..7029bf7 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -2342,7 +2342,7 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents,
bfd_put_32 (abfd, 1 << sec->alignment_power,
&echdr->ch_addralign);
/* bfd_log2 (alignof (Elf32_Chdr)) */
- bfd_set_section_alignment (abfd, sec, 2);
+ bfd_set_section_alignment (sec, 2);
}
else
{
@@ -2354,7 +2354,7 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents,
bfd_put_64 (abfd, 1 << sec->alignment_power,
&echdr->ch_addralign);
/* bfd_log2 (alignof (Elf64_Chdr)) */
- bfd_set_section_alignment (abfd, sec, 3);
+ bfd_set_section_alignment (sec, 3);
}
}
else
@@ -2368,7 +2368,7 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents,
memcpy (contents, "ZLIB", 4);
bfd_putb64 (sec->size, contents + 4);
/* No way to keep the original alignment, just use 1 always. */
- bfd_set_section_alignment (abfd, sec, 0);
+ bfd_set_section_alignment (sec, 0);
}
}
}
@@ -2597,7 +2597,7 @@ bfd_convert_section_contents (bfd *ibfd, sec_ptr isec, bfd *obfd,
use_memmove = TRUE;
}
- size = bfd_get_section_size (isec) - ihdr_size + ohdr_size;
+ size = bfd_section_size (isec) - ihdr_size + ohdr_size;
if (!use_memmove)
{
contents = (bfd_byte *) bfd_malloc (size);
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index ee4a3ee..d36921b 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -426,7 +426,7 @@ alpha_ecoff_object_p (bfd *abfd)
size = sec->line_filepos * 8;
BFD_ASSERT (size == sec->size
|| size + 8 == sec->size);
- if (! bfd_set_section_size (abfd, sec, size))
+ if (!bfd_set_section_size (sec, size))
return NULL;
}
}
@@ -1237,7 +1237,7 @@ alpha_convert_external_reloc (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Compute a new r_symndx value. */
hsec = h->root.u.def.section;
- name = bfd_get_section_name (output_bfd, hsec->output_section);
+ name = bfd_section_name (hsec->output_section);
r_symndx = (unsigned long) -1;
switch (name[1])
@@ -1928,8 +1928,7 @@ alpha_relocate_section (bfd *output_bfd,
if (r_extern)
name = sym_hashes[r_symndx]->root.root.string;
else
- name = bfd_section_name (input_bfd,
- symndx_to_section[r_symndx]);
+ name = bfd_section_name (symndx_to_section[r_symndx]);
(*info->callbacks->reloc_overflow)
(info, NULL, name, alpha_howto_table[r_type].name,
(bfd_vma) 0, input_bfd, input_section,
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index 5237bfb..cbc5257 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -1989,7 +1989,7 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd,
sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME,
flags);
if (sec == NULL
- || ! bfd_set_section_alignment (abfd, sec, 2))
+ || !bfd_set_section_alignment (sec, 2))
return FALSE;
}
@@ -2003,7 +2003,7 @@ bfd_arm_get_bfd_for_interworking (bfd * abfd,
flags);
if (sec == NULL
- || ! bfd_set_section_alignment (abfd, sec, 2))
+ || !bfd_set_section_alignment (sec, 2))
return FALSE;
}
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index a2dd9e1..c6fe679 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -1012,8 +1012,7 @@ mips_relocate_section (bfd *output_bfd,
/* Compute a new r_symndx value. */
s = h->root.u.def.section;
- name = bfd_get_section_name (output_bfd,
- s->output_section);
+ name = bfd_section_name (s->output_section);
int_rel.r_symndx = -1;
switch (name[1])
@@ -1223,7 +1222,7 @@ mips_relocate_section (bfd *output_bfd,
if (int_rel.r_extern)
name = NULL;
else
- name = bfd_section_name (input_bfd, s);
+ name = bfd_section_name (s);
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section,
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index 1c80a9d..091da1f 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -959,7 +959,7 @@ xcoff64_write_object_contents (bfd *abfd)
if (text_sec != NULL)
{
internal_a.o_sntext = text_sec->target_index;
- internal_a.o_algntext = bfd_get_section_alignment (abfd, text_sec);
+ internal_a.o_algntext = bfd_section_alignment (text_sec);
}
else
{
@@ -970,7 +970,7 @@ xcoff64_write_object_contents (bfd *abfd)
if (data_sec != NULL)
{
internal_a.o_sndata = data_sec->target_index;
- internal_a.o_algndata = bfd_get_section_alignment (abfd, data_sec);
+ internal_a.o_algndata = bfd_section_alignment (data_sec);
}
else
{
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index dd3189f..948bb70 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1696,7 +1696,7 @@ coff_set_custom_section_alignment (bfd *abfd ATTRIBUTE_UNUSED,
for (i = 0; i < table_size; ++i)
{
- const char *secname = bfd_get_section_name (abfd, section);
+ const char *secname = bfd_section_name (section);
if (alignment_table[i].comparison_length == (unsigned int) -1
? strcmp (alignment_table[i].name, secname) == 0
@@ -1759,17 +1759,17 @@ coff_new_section_hook (bfd * abfd, asection * section)
#ifdef RS6000COFF_C
if (bfd_xcoff_text_align_power (abfd) != 0
- && strcmp (bfd_get_section_name (abfd, section), ".text") == 0)
+ && strcmp (bfd_section_name (section), ".text") == 0)
section->alignment_power = bfd_xcoff_text_align_power (abfd);
else if (bfd_xcoff_data_align_power (abfd) != 0
- && strcmp (bfd_get_section_name (abfd, section), ".data") == 0)
+ && strcmp (bfd_section_name (section), ".data") == 0)
section->alignment_power = bfd_xcoff_data_align_power (abfd);
else
{
int i;
for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++)
- if (strcmp (bfd_get_section_name (abfd, section),
+ if (strcmp (bfd_section_name (section),
xcoff_dwsect_names[i].name) == 0)
{
section->alignment_power = 0;
@@ -3221,7 +3221,7 @@ coff_compute_section_file_positions (bfd * abfd)
incremented in coff_set_section_contents. This is right for
SVR3.2. */
if (strcmp (current->name, _LIB) == 0)
- (void) bfd_set_section_vma (abfd, current, 0);
+ bfd_set_section_vma (current, 0);
#endif
#ifdef ALIGN_SECTIONS_IN_FILE
@@ -4011,7 +4011,7 @@ coff_write_object_contents (bfd * abfd)
if (text_sec != NULL)
{
internal_a.o_sntext = text_sec->target_index;
- internal_a.o_algntext = bfd_get_section_alignment (abfd, text_sec);
+ internal_a.o_algntext = bfd_section_alignment (text_sec);
}
else
{
@@ -4021,7 +4021,7 @@ coff_write_object_contents (bfd * abfd)
if (data_sec != NULL)
{
internal_a.o_sndata = data_sec->target_index;
- internal_a.o_algndata = bfd_get_section_alignment (abfd, data_sec);
+ internal_a.o_algndata = bfd_section_alignment (data_sec);
}
else
{
@@ -4390,8 +4390,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
PR 17521: file: 078-10659-0.004. */
continue;
else
- cache_ptr->u.offset = (dst.l_addr.l_paddr
- - bfd_section_vma (abfd, asect));
+ cache_ptr->u.offset = dst.l_addr.l_paddr - bfd_section_vma (asect);
cache_ptr++;
}
@@ -4886,7 +4885,7 @@ coff_classify_symbol (bfd *abfd,
name = _bfd_coff_internal_syment_name (abfd, syment, buf)
sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
if (sec != NULL && name != NULL
- && (strcmp (bfd_get_section_name (abfd, sec), name) == 0))
+ && (strcmp (bfd_section_name (sec), name) == 0))
return COFF_SYMBOL_PE_SECTION;
}
#endif
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 80a9a2a..ba7bb5e 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -217,7 +217,7 @@ make_a_section_from_file (bfd *abfd,
break;
}
if (new_name != NULL)
- bfd_rename_section (abfd, return_section, new_name);
+ bfd_rename_section (return_section, new_name);
}
return result;
@@ -2366,7 +2366,7 @@ coff_find_nearest_line_with_names (bfd *abfd,
bfd_vma maxdiff;
/* Look through the C_FILE symbols to find the best one. */
- sec_vma = bfd_get_section_vma (abfd, section);
+ sec_vma = bfd_section_vma (section);
*filename_ptr = (char *) p->u.syment._n._n_n._n_offset;
maxdiff = (bfd_vma) 0 - (bfd_vma) 1;
while (1)
@@ -2658,7 +2658,7 @@ _bfd_coff_section_already_linked (bfd *abfd,
if ((flags & SEC_GROUP) != 0)
return FALSE;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
s_comdat = bfd_coff_get_comdat_section (abfd, sec);
if (s_comdat != NULL)
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 7bcc1ca..2115e9c 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -2846,8 +2846,7 @@ _bfd_coff_reloc_link_order (bfd *output_bfd,
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL,
(link_order->type == bfd_section_reloc_link_order
- ? bfd_section_name (output_bfd,
- link_order->u.reloc.p->u.section)
+ ? bfd_section_name (link_order->u.reloc.p->u.section)
: link_order->u.reloc.p->u.name),
howto->name, link_order->u.reloc.p->addend,
(bfd *) NULL, (asection *) NULL, (bfd_vma) 0);
diff --git a/bfd/compress.c b/bfd/compress.c
index 32de099..8f96d06 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -155,8 +155,7 @@ bfd_compress_section_contents (bfd *abfd, sec_ptr sec,
return 0;
}
free (uncompressed_buffer);
- bfd_set_section_alignment (abfd, sec,
- orig_uncompressed_alignment_pow);
+ bfd_set_section_alignment (sec, orig_uncompressed_alignment_pow);
sec->contents = buffer;
sec->compress_status = COMPRESS_SECTION_DONE;
@@ -255,7 +254,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
&& filesize < sz
/* PR 24753: Linker created sections can be larger than
the file size, eg if they are being used to hold stubs. */
- && (bfd_get_section_flags (abfd, sec) & SEC_LINKER_CREATED) == 0
+ && (bfd_section_flags (sec) & SEC_LINKER_CREATED) == 0
/* The MMO file format supports its own special compression
technique, but it uses COMPRESS_SECTION_NONE when loading
a section's contents. */
@@ -552,7 +551,7 @@ bfd_init_section_decompress_status (bfd *abfd, sec_ptr sec)
sec->compressed_size = sec->size;
sec->size = uncompressed_size;
- bfd_set_section_alignment (abfd, sec, uncompressed_alignment_power);
+ bfd_set_section_alignment (sec, uncompressed_alignment_power);
sec->compress_status = DECOMPRESS_SECTION_SIZED;
return TRUE;
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index c06fa5e..30adba0 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -1676,10 +1676,10 @@ ecoff_slurp_reloc_table (bfd *abfd,
abort ();
rptr->sym_ptr_ptr = sec->symbol_ptr_ptr;
- rptr->addend = - bfd_get_section_vma (abfd, sec);
+ rptr->addend = - bfd_section_vma (sec);
}
- rptr->address = intern.r_vaddr - bfd_get_section_vma (abfd, section);
+ rptr->address = intern.r_vaddr - bfd_section_vma (section);
/* Let the backend select the howto field and do any other
required processing. */
@@ -2431,7 +2431,7 @@ _bfd_ecoff_write_object_contents (bfd *abfd)
strncpy (section.s_name, current->name, sizeof section.s_name);
/* This seems to be correct for Irix 4 shared libraries. */
- vma = bfd_get_section_vma (abfd, current);
+ vma = bfd_section_vma (current);
if (streq (current->name, _LIB))
section.s_vaddr = 0;
else
@@ -2682,8 +2682,7 @@ _bfd_ecoff_write_object_contents (bfd *abfd)
if (reloc->howto == NULL)
continue;
- in.r_vaddr = (reloc->address
- + bfd_get_section_vma (abfd, current));
+ in.r_vaddr = reloc->address + bfd_section_vma (current);
in.r_type = reloc->howto->type;
if ((sym->flags & BSF_SECTION_SYM) == 0)
@@ -2719,7 +2718,7 @@ _bfd_ecoff_write_object_contents (bfd *abfd)
{ _RCONST, RELOC_SECTION_RCONST }
};
- name = bfd_get_section_name (abfd, bfd_asymbol_section (sym));
+ name = bfd_section_name (bfd_asymbol_section (sym));
for (j = 0; j < ARRAY_SIZE (section_symndx); j++)
if (streq (name, section_symndx[j].name))
@@ -4010,7 +4009,7 @@ ecoff_reloc_link_order (bfd *output_bfd,
(*info->callbacks->reloc_overflow)
(info, NULL,
(link_order->type == bfd_section_reloc_link_order
- ? bfd_section_name (output_bfd, section)
+ ? bfd_section_name (section)
: link_order->u.reloc.p->u.name),
rel.howto->name, addend, NULL, NULL, (bfd_vma) 0);
break;
@@ -4025,8 +4024,7 @@ ecoff_reloc_link_order (bfd *output_bfd,
rel.addend = 0;
/* Move the information into an internal_reloc structure. */
- in.r_vaddr = (rel.address
- + bfd_get_section_vma (output_bfd, output_section));
+ in.r_vaddr = rel.address + bfd_section_vma (output_section);
in.r_type = rel.howto->type;
if (type == bfd_symbol_reloc_link_order)
@@ -4076,7 +4074,7 @@ ecoff_reloc_link_order (bfd *output_bfd,
{ _RCONST, RELOC_SECTION_RCONST }
};
- name = bfd_get_section_name (output_bfd, section);
+ name = bfd_section_name (section);
for (i = 0; i < ARRAY_SIZE (section_symndx); i++)
if (streq (name, section_symndx[i].name))
@@ -4189,7 +4187,7 @@ ecoff_link_write_external (struct bfd_hash_entry *bh, void * data)
};
output_section = h->root.u.def.section->output_section;
- name = bfd_section_name (output_section->owner, output_section);
+ name = bfd_section_name (output_section);
for (i = 0; i < ARRAY_SIZE (section_storage_classes); i++)
if (streq (name, section_storage_classes[i].name))
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 6919ac3..c2cb77b 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -1109,7 +1109,7 @@ add_eh_frame_hdr_terminator (asection *sec,
if (!sec->rawsize)
sec->rawsize = sec->size;
- bfd_set_section_size (sec->owner, sec, sec->size + 8);
+ bfd_set_section_size (sec, sec->size + 8);
}
/* Finish a pass over all .eh_frame_entry sections. */
@@ -1682,7 +1682,7 @@ _bfd_elf_eh_frame_entry_present (struct bfd_link_info *info)
{
for (o = abfd->sections; o; o = o->next)
{
- const char *name = bfd_get_section_name (abfd, o);
+ const char *name = bfd_section_name (o);
if (strcmp (name, ".eh_frame_entry")
&& !bfd_is_abs_section (o->output_section))
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index cc98cae..2035d4c9c 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -881,7 +881,7 @@ elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".PARISC.unwind") == 0)
{
diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c
index 89054e4..58948e3 100644
--- a/bfd/elf-ifunc.c
+++ b/bfd/elf-ifunc.c
@@ -62,8 +62,7 @@ _bfd_elf_create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_with_flags (abfd, rel_sec,
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelifunc = s;
}
@@ -73,7 +72,7 @@ _bfd_elf_create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
for static executables. */
s = bfd_make_section_with_flags (abfd, ".iplt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->iplt = s;
@@ -82,8 +81,7 @@ _bfd_elf_create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
? ".rela.iplt" : ".rel.iplt"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelplt = s;
@@ -94,8 +92,7 @@ _bfd_elf_create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
else
s = bfd_make_section_with_flags (abfd, ".igot", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->igotplt = s;
}
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index cfccb96..b234c16 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -413,7 +413,7 @@ mn10200_elf_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index acc3c54..30828f1 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -725,7 +725,7 @@ _bfd_mn10300_elf_create_got_section (bfd * abfd,
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
htab->splt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
@@ -742,7 +742,7 @@ _bfd_mn10300_elf_create_got_section (bfd * abfd,
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
htab->sgot = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_plt)
@@ -750,7 +750,7 @@ _bfd_mn10300_elf_create_got_section (bfd * abfd,
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
htab->sgotplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
@@ -2125,7 +2125,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
@@ -4821,7 +4821,7 @@ _bfd_mn10300_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags | SEC_READONLY);
htab->root.srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (! _bfd_mn10300_elf_create_got_section (abfd, info))
@@ -4858,7 +4858,7 @@ _bfd_mn10300_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
@@ -5073,7 +5073,7 @@ _bfd_mn10300_elf_size_dynamic_sections (bfd * output_bfd,
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (streq (name, ".plt"))
{
@@ -5099,8 +5099,7 @@ _bfd_mn10300_elf_size_dynamic_sections (bfd * output_bfd,
entry. The entries in the .rela.plt section
really apply to the .got section, which we
created ourselves and so know is not readonly. */
- outname = bfd_get_section_name (output_bfd,
- s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 5);
if (target != NULL
&& (target->flags & SEC_READONLY) != 0
diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c
index 198eece..199e617 100644
--- a/bfd/elf-properties.c
+++ b/bfd/elf-properties.c
@@ -695,12 +695,12 @@ _bfd_elf_convert_gnu_properties (bfd *ibfd, asection *isec,
align_shift = bed->s->elfclass == ELFCLASS64 ? 3 : 2;
/* Get the output .note.gnu.property section size. */
- size = bfd_get_section_size (isec->output_section);
+ size = bfd_section_size (isec->output_section);
/* Update the output .note.gnu.property section alignment. */
- bfd_set_section_alignment (obfd, isec->output_section, align_shift);
+ bfd_set_section_alignment (isec->output_section, align_shift);
- if (size > bfd_get_section_size (isec))
+ if (size > bfd_section_size (isec))
{
contents = (bfd_byte *) bfd_malloc (size);
free (*ptr);
diff --git a/bfd/elf-s390-common.c b/bfd/elf-s390-common.c
index ef8abeb..d7cd7e6 100644
--- a/bfd/elf-s390-common.c
+++ b/bfd/elf-s390-common.c
@@ -131,8 +131,7 @@ s390_elf_create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_with_flags (abfd, ".rela.ifunc",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelifunc = s;
}
@@ -141,21 +140,19 @@ s390_elf_create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_with_flags (abfd, ".iplt",
flags | SEC_CODE | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->iplt = s;
s = bfd_make_section_with_flags (abfd, ".rela.iplt", flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelplt = s;
s = bfd_make_section_with_flags (abfd, ".igot.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->igotplt = s;
diff --git a/bfd/elf-vxworks.c b/bfd/elf-vxworks.c
index a7f574c..8fe17bf 100644
--- a/bfd/elf-vxworks.c
+++ b/bfd/elf-vxworks.c
@@ -97,7 +97,7 @@ elf_vxworks_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info,
| SEC_READONLY
| SEC_LINKER_CREATED);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
*srelplt2_out = s;
@@ -279,9 +279,7 @@ elf_vxworks_finish_dynamic_entry (bfd *output_bfd, Elf_Internal_Dyn *dyn)
case DT_VX_WRS_TLS_DATA_ALIGN:
sec = bfd_get_section_by_name (output_bfd, ".tls_data");
- dyn->d_un.d_val
- = (bfd_size_type)1 << bfd_get_section_alignment (output_bfd,
- sec);
+ dyn->d_un.d_val = (bfd_size_type) 1 << bfd_section_alignment (sec);
break;
case DT_VX_WRS_TLS_VARS_START:
diff --git a/bfd/elf.c b/bfd/elf.c
index 1a1eed9..664eae5 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -547,7 +547,7 @@ bfd_elf_sym_name (bfd *abfd,
if (name == NULL)
name = "(null)";
else if (sym_sec && *name == '\0')
- name = bfd_section_name (abfd, sym_sec);
+ name = bfd_section_name (sym_sec);
return name;
}
@@ -1049,10 +1049,9 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
newsect->filepos = hdr->sh_offset;
- if (! bfd_set_section_vma (abfd, newsect, hdr->sh_addr)
- || ! bfd_set_section_size (abfd, newsect, hdr->sh_size)
- || ! bfd_set_section_alignment (abfd, newsect,
- bfd_log2 (hdr->sh_addralign)))
+ if (!bfd_set_section_vma (newsect, hdr->sh_addr)
+ || !bfd_set_section_size (newsect, hdr->sh_size)
+ || !bfd_set_section_alignment (newsect, bfd_log2 (hdr->sh_addralign)))
return FALSE;
flags = SEC_NO_FLAGS;
@@ -1142,7 +1141,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
if (! bed->elf_backend_section_flags (&flags, hdr))
return FALSE;
- if (! bfd_set_section_flags (abfd, newsect, flags))
+ if (!bfd_set_section_flags (newsect, flags))
return FALSE;
/* We do not parse the PT_NOTE segments as we are interested even in the
@@ -1286,7 +1285,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
char *new_name = convert_zdebug_to_debug (abfd, name);
if (new_name == NULL)
return FALSE;
- bfd_rename_section (abfd, newsect, new_name);
+ bfd_rename_section (newsect, new_name);
}
}
else
@@ -5542,7 +5541,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
{
unsigned int secalign;
- secalign = bfd_get_section_alignment (abfd, *secpp);
+ secalign = bfd_section_alignment (*secpp);
if (secalign > align_power)
align_power = secalign;
}
@@ -5696,7 +5695,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
sec = *secpp;
this_hdr = &elf_section_data (sec)->this_hdr;
- align = (bfd_size_type) 1 << bfd_get_section_alignment (abfd, sec);
+ align = (bfd_size_type) 1 << bfd_section_alignment (sec);
if ((p->p_type == PT_LOAD
|| p->p_type == PT_TLS)
@@ -6835,8 +6834,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
|| (segment->p_paddr \
? segment->p_paddr != section->lma \
: segment->p_vaddr != section->vma) \
- || (strcmp (bfd_get_section_name (ibfd, section), ".dynamic") \
- == 0)) \
+ || (strcmp (bfd_section_name (section), ".dynamic") == 0)) \
&& (segment->p_type != PT_LOAD || !section->segment_mark))
/* If the output section of a section in the input segment is NULL,
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 493f32d..91537ef 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -900,7 +900,7 @@ arc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
{
- if ((bfd_get_section_flags (ibfd, sec)
+ if ((bfd_section_flags (sec)
& (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
== (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
only_data_sections = FALSE;
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index e29a60a..1c4887a 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -3817,7 +3817,8 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
htab->srofixup = bfd_make_section_with_flags (dynobj, ".rofixup",
(SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY));
- if (htab->srofixup == NULL || ! bfd_set_section_alignment (dynobj, htab->srofixup, 2))
+ if (htab->srofixup == NULL
+ || !bfd_set_section_alignment (htab->srofixup, 2))
return FALSE;
}
@@ -3845,7 +3846,7 @@ create_ifunc_sections (struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (dynobj, ".iplt",
flags | SEC_READONLY | SEC_CODE);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->root.iplt = s;
}
@@ -3856,7 +3857,7 @@ create_ifunc_sections (struct bfd_link_info *info)
RELOC_SECTION (htab, ".iplt"),
flags | SEC_READONLY);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->root.irelplt = s;
}
@@ -3865,7 +3866,7 @@ create_ifunc_sections (struct bfd_link_info *info)
{
s = bfd_make_section_anyway_with_flags (dynobj, ".igot.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->root.igotplt = s;
}
@@ -7709,7 +7710,7 @@ arm_make_glue_section (bfd * abfd, const char * name)
sec = bfd_make_section_anyway_with_flags (abfd, name, ARM_GLUE_SECTION_FLAGS);
if (sec == NULL
- || !bfd_set_section_alignment (abfd, sec, 2))
+ || !bfd_set_section_alignment (sec, 2))
return FALSE;
/* Set the gc mark to prevent the section from being removed by garbage
@@ -13374,7 +13375,7 @@ elf32_arm_relocate_section (bfd * output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r_symndx != STN_UNDEF
@@ -13552,10 +13553,10 @@ adjust_exidx_size(asection *exidx_sec, int adjust)
if (!exidx_sec->rawsize)
exidx_sec->rawsize = exidx_sec->size;
- bfd_set_section_size (exidx_sec->owner, exidx_sec, exidx_sec->size + adjust);
+ bfd_set_section_size (exidx_sec, exidx_sec->size + adjust);
out_sec = exidx_sec->output_section;
/* Adjust size of output section. */
- bfd_set_section_size (out_sec->owner, out_sec, out_sec->size +adjust);
+ bfd_set_section_size (out_sec, out_sec->size +adjust);
}
/* Insert an EXIDX_CANTUNWIND marker at the end of a section. */
@@ -15696,9 +15697,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
flagword flags;
- flags = bfd_get_section_flags (dynobj, sreloc);
+ flags = bfd_section_flags (sreloc);
flags &= ~(SEC_LOAD | SEC_ALLOC);
- bfd_set_section_flags (dynobj, sreloc, flags);
+ bfd_set_section_flags (sreloc, flags);
}
}
@@ -17158,7 +17159,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (s == htab->root.splt)
{
@@ -17951,7 +17952,7 @@ elf32_arm_fake_sections (bfd * abfd, Elf_Internal_Shdr * hdr, asection * sec)
{
const char * name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (is_arm_elf_unwind_section_name (abfd, name))
{
@@ -20874,7 +20875,7 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (strcmp (sec->name, ".glue_7")
&& strcmp (sec->name, ".glue_7t"))
{
- if ((bfd_get_section_flags (ibfd, sec)
+ if ((bfd_section_flags (sec)
& (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
== (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
only_data_sections = FALSE;
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index e75ac9f..f04cc94 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -1465,7 +1465,7 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
@@ -2354,8 +2354,7 @@ avr_property_record_compare (const void *ap, const void *bp)
return (a->offset - b->offset);
if (a->section != b->section)
- return (bfd_get_section_vma (a->section->owner, a->section)
- - bfd_get_section_vma (b->section->owner, b->section));
+ return bfd_section_vma (a->section) - bfd_section_vma (b->section);
return (a->type - b->type);
}
@@ -3948,12 +3947,12 @@ internal_reloc_compare (const void *ap, const void *bp)
/* Return true if ADDRESS is within the vma range of SECTION from ABFD. */
static bfd_boolean
-avr_is_section_for_address (bfd *abfd, asection *section, bfd_vma address)
+avr_is_section_for_address (asection *section, bfd_vma address)
{
bfd_vma vma;
bfd_size_type size;
- vma = bfd_get_section_vma (abfd, section);
+ vma = bfd_section_vma (section);
if (address < vma)
return FALSE;
@@ -3985,7 +3984,7 @@ struct avr_find_section_data
perform any checks, and just returns. */
static void
-avr_find_section_for_address (bfd *abfd,
+avr_find_section_for_address (bfd *abfd ATTRIBUTE_UNUSED,
asection *section, void *data)
{
struct avr_find_section_data *fs_data
@@ -3996,11 +3995,11 @@ avr_find_section_for_address (bfd *abfd,
return;
/* If this section isn't part of the addressable code content, skip it. */
- if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0
- && (bfd_get_section_flags (abfd, section) & SEC_CODE) == 0)
+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0
+ && (bfd_section_flags (section) & SEC_CODE) == 0)
return;
- if (avr_is_section_for_address (abfd, section, fs_data->address))
+ if (avr_is_section_for_address (section, fs_data->address))
fs_data->section = section;
}
@@ -4023,7 +4022,7 @@ avr_elf32_load_records_from_section (bfd *abfd, asection *sec)
fs_data.section = NULL;
- size = bfd_get_section_size (sec);
+ size = bfd_section_size (sec);
contents = bfd_malloc (size);
bfd_get_section_contents (abfd, sec, contents, 0, size);
ptr = contents;
@@ -4126,8 +4125,7 @@ avr_elf32_load_records_from_section (bfd *abfd, asection *sec)
{
/* Try to find section and offset from address. */
if (fs_data.section != NULL
- && !avr_is_section_for_address (abfd, fs_data.section,
- address))
+ && !avr_is_section_for_address (fs_data.section, address))
fs_data.section = NULL;
if (fs_data.section == NULL)
@@ -4145,7 +4143,7 @@ avr_elf32_load_records_from_section (bfd *abfd, asection *sec)
r_list->records [i].section = fs_data.section;
r_list->records [i].offset
- = address - bfd_get_section_vma (abfd, fs_data.section);
+ = address - bfd_section_vma (fs_data.section);
}
r_list->records [i].type = *((bfd_byte *) ptr);
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index d73bfda..6efee04 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1601,7 +1601,7 @@ bfin_relocate_section (bfd * output_bfd,
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
@@ -2560,7 +2560,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
@@ -2778,8 +2778,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
bfd_vma offset;
addend += bfinfdpic_got_section (info)->output_section->vma;
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_bfinfdpic_osec_readonly_p (output_bfd,
@@ -2807,8 +2806,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
picrel);
}
}
- else if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ else if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
@@ -2901,8 +2899,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
if (osec)
addend += osec->output_section->vma;
if (IS_FDPIC (input_bfd)
- && (bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ && (bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_bfinfdpic_osec_readonly_p (output_bfd,
@@ -2939,8 +2936,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
}
else
{
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_bfinfdpic_osec_readonly_p (output_bfd,
@@ -3201,7 +3197,7 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
elf_hash_table (info)->sgot = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_sym)
@@ -3238,7 +3234,7 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".rel.got",
(flags | SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
bfinfdpic_gotrel_section (info) = s;
@@ -3247,7 +3243,7 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".rofixup",
(flags | SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
bfinfdpic_gotfixup_section (info) = s;
@@ -3261,7 +3257,7 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
/* Blackfin-specific: remember it. */
bfinfdpic_plt_section (info) = s;
@@ -3289,7 +3285,7 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".rel.plt",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
/* Blackfin-specific: remember it. */
bfinfdpic_pltrel_section (info) = s;
@@ -3355,7 +3351,7 @@ elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
".rela.bss",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
}
}
@@ -4616,7 +4612,7 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_BFIN_FUNCDESC_VALUE:
picrel->relocsfdv++;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32--;
/* Fall through. */
@@ -4625,7 +4621,7 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info,
break;
picrel->sym++;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32++;
break;
@@ -5064,9 +5060,9 @@ bfin_adjust_dynamic_symbol (struct bfd_link_info *info,
/* Apply the required alignment. */
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
- if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ if (power_of_two > bfd_section_alignment (s))
{
- if (!bfd_set_section_alignment (dynobj, s, power_of_two))
+ if (!bfd_set_section_alignment (s, power_of_two))
return FALSE;
}
@@ -5200,7 +5196,7 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
strip = FALSE;
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index 7d0a0e5..72642e5 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -610,7 +610,7 @@ _bfd_cr16_elf_create_got_section (bfd * abfd, struct bfd_link_info * info)
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
htab->sgot= s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_plt)
@@ -618,7 +618,7 @@ _bfd_cr16_elf_create_got_section (bfd * abfd, struct bfd_link_info * info)
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
htab->sgotplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
@@ -1444,7 +1444,7 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
@@ -2241,7 +2241,7 @@ _bfd_cr16_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags | SEC_READONLY);
htab->srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (! _bfd_cr16_elf_create_got_section (abfd, info))
@@ -2278,7 +2278,7 @@ _bfd_cr16_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
@@ -2463,7 +2463,7 @@ _bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd,
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strcmp (name, ".plt") == 0)
{
@@ -2489,8 +2489,7 @@ _bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd,
entry. The entries in the .rela.plt section
really apply to the .got section, which we
created ourselves and so know is not readonly. */
- outname = bfd_get_section_name (output_bfd,
- s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 5);
if (target != NULL
&& (target->flags & SEC_READONLY) != 0
diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c
index 9a2fda0..35bacbb 100644
--- a/bfd/elf32-cr16c.c
+++ b/bfd/elf32-cr16c.c
@@ -763,7 +763,7 @@ elf32_cr16c_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
@@ -827,9 +827,9 @@ elf32_cr16c_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".fcommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".fcommon") == 0)
*retval = SHN_CR16C_FCOMMON;
- else if (strcmp (bfd_get_section_name (abfd, sec), ".ncommon") == 0)
+ else if (strcmp (bfd_section_name (sec), ".ncommon") == 0)
*retval = SHN_CR16C_NCOMMON;
else
return FALSE;
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 5d23056..9c07b6d 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1044,7 +1044,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
symname = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (symname == NULL)
- symname = bfd_section_name (input_bfd, sec);
+ symname = bfd_section_name (sec);
}
else
{
@@ -2480,7 +2480,7 @@ cris_elf_plt_sym_val (bfd_vma i ATTRIBUTE_UNUSED, const asection *plt,
if ((got = bfd_get_section_by_name (abfd, ".got")) == NULL)
return (bfd_vma) -1;
- plt_sec_size = bfd_section_size (plt->owner, plt);
+ plt_sec_size = bfd_section_size (plt);
plt_entry_size
= (bfd_get_mach (abfd) == bfd_mach_cris_v32
? PLT_ENTRY_SIZE_V32 : PLT_ENTRY_SIZE);
@@ -3580,7 +3580,7 @@ elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strcmp (name, ".plt") == 0)
{
diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c
index 306a0e4..6d15b2b 100644
--- a/bfd/elf32-crx.c
+++ b/bfd/elf32-crx.c
@@ -905,7 +905,7 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c
index b3451b6..16897b3 100644
--- a/bfd/elf32-csky.c
+++ b/bfd/elf32-csky.c
@@ -2092,7 +2092,7 @@ csky_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab->elf.hplt != NULL)
strip_section = FALSE;
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rel") )
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rel") )
{
if (s->size != 0 )
relocs = TRUE;
@@ -5070,7 +5070,7 @@ csky_elf_relocate_section (bfd * output_bfd,
if (name == NULL)
break;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
(*info->callbacks->reloc_overflow)
(info,
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index a03ce63..bd07ad6 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -482,7 +482,7 @@ elf32_d10v_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
diff --git a/bfd/elf32-epiphany.c b/bfd/elf32-epiphany.c
index 4bd417d..c45f0b3 100644
--- a/bfd/elf32-epiphany.c
+++ b/bfd/elf32-epiphany.c
@@ -518,7 +518,7 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index 6a13767..0d299c6 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -549,7 +549,7 @@ fr30_elf_relocate_section (bfd *output_bfd,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 8c6a97d..7770687 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -2736,7 +2736,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
if (name == NULL || name[0] == 0)
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
else
{
@@ -3566,8 +3566,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
&& (!h || FRVFDPIC_FUNCDESC_LOCAL (info, h)))
{
addend += frvfdpic_got_section (info)->output_section->vma;
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
@@ -3597,8 +3596,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
picrel);
}
}
- else if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ else if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
@@ -3691,8 +3689,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
if (osec)
addend += osec->output_section->vma;
if (IS_FDPIC (input_bfd)
- && (bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ && (bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_frvfdpic_osec_readonly_p (output_bfd,
@@ -3732,8 +3729,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
@@ -4192,7 +4188,7 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
elf_hash_table (info)->sgot = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_sym)
@@ -4230,14 +4226,14 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
(flags | SEC_READONLY));
elf_hash_table (info)->srelgot = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
/* Machine-specific. */
s = bfd_make_section_anyway_with_flags (abfd, ".rofixup",
(flags | SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
frvfdpic_gotfixup_section (info) = s;
@@ -4285,7 +4281,7 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
/* FRV-specific: remember it. */
frvfdpic_plt_section (info) = s;
@@ -4305,7 +4301,7 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".rel.plt",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
/* FRV-specific: remember it. */
frvfdpic_pltrel_section (info) = s;
@@ -4373,7 +4369,7 @@ elf32_frvfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
}
}
@@ -6137,7 +6133,7 @@ elf32_frv_check_relocs (bfd *abfd,
case R_FRV_FUNCDESC_VALUE:
picrel->relocsfdv++;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32--;
/* Fall through. */
@@ -6146,7 +6142,7 @@ elf32_frv_check_relocs (bfd *abfd,
break;
picrel->sym = 1;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32++;
break;
diff --git a/bfd/elf32-ft32.c b/bfd/elf32-ft32.c
index d673724..b8e69e5 100644
--- a/bfd/elf32-ft32.c
+++ b/bfd/elf32-ft32.c
@@ -389,7 +389,7 @@ ft32_elf_relocate_section (bfd *output_bfd,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index a2f06d5..ba7c8b2 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -502,7 +502,7 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index a61adbc..f065449 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -2270,12 +2270,12 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Make space for the plt stub at the end of the .plt
section. We want this stub right at the end, up
against the .got section. */
- int gotalign = bfd_section_alignment (dynobj, htab->etab.sgot);
- int pltalign = bfd_section_alignment (dynobj, sec);
+ int gotalign = bfd_section_alignment (htab->etab.sgot);
+ int pltalign = bfd_section_alignment (sec);
bfd_size_type mask;
if (gotalign > pltalign)
- (void) bfd_set_section_alignment (dynobj, sec, gotalign);
+ bfd_set_section_alignment (sec, gotalign);
mask = ((bfd_size_type) 1 << gotalign) - 1;
sec->size = (sec->size + sizeof (plt_stub) + mask) & ~mask;
}
@@ -2284,7 +2284,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|| sec == htab->etab.sdynbss
|| sec == htab->etab.sdynrelro)
;
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, sec), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (sec), ".rela"))
{
if (sec->size != 0)
{
@@ -4151,7 +4151,7 @@ elf32_hppa_relocate_section (bfd *output_bfd,
if (sym_name == NULL)
return FALSE;
if (*sym_name == '\0')
- sym_name = bfd_section_name (input_bfd, sym_sec);
+ sym_name = bfd_section_name (sym_sec);
_bfd_error_handler
(_("%pB:%s has both normal and TLS relocs"),
input_bfd, sym_name);
@@ -4201,7 +4201,7 @@ elf32_hppa_relocate_section (bfd *output_bfd,
if (sym_name == NULL)
return FALSE;
if (*sym_name == '\0')
- sym_name = bfd_section_name (input_bfd, sym_sec);
+ sym_name = bfd_section_name (sym_sec);
}
howto = elf_hppa_howto_table + r_type;
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index d7a61d7..9248ef5 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1948,7 +1948,7 @@ elf_i386_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
/* This is an ugly, but unfortunately necessary hack that is
needed when producing EFI binaries on x86. It tells
@@ -3429,7 +3429,7 @@ check_relocation_error:
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 43e7be6..6e5131f 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -1435,7 +1435,7 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index 6e47027..e95f1a5 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -625,7 +625,7 @@ iq2000_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, osec) : name;
+ name = name == NULL ? bfd_section_name (osec) : name;
}
else
{
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index 5233dbb..0601f14 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -195,8 +195,7 @@ create_rofixup_section (bfd *dynobj, struct bfd_link_info *info)
| SEC_LINKER_CREATED
| SEC_READONLY));
if (lm32fdpic_fixup32_section (info) == NULL
- || ! bfd_set_section_alignment (dynobj,
- lm32fdpic_fixup32_section (info), 2))
+ || !bfd_set_section_alignment (lm32fdpic_fixup32_section (info), 2))
return FALSE;
return TRUE;
@@ -821,7 +820,7 @@ lm32_elf_relocate_section (bfd *output_bfd,
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
@@ -1036,7 +1035,7 @@ lm32_elf_relocate_section (bfd *output_bfd,
if ((!h) || (h && h->root.type != bfd_link_hash_undefweak))
{
/* Only create .rofixup entries for relocs in loadable sections. */
- if ((bfd_get_section_flags (output_bfd, input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
@@ -1090,7 +1089,7 @@ lm32_elf_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
@@ -2120,7 +2119,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd,
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->root.srelplt)
relocs = TRUE;
@@ -2255,7 +2254,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd,
/* Don't generate entries for weak symbols. */
if (!h || (h && h->root.type != bfd_link_hash_undefweak))
{
- if (!discarded_section (s) && !((bfd_get_section_flags (ibfd, s) & SEC_ALLOC) == 0))
+ if (!discarded_section (s) && !((bfd_section_flags (s) & SEC_ALLOC) == 0))
{
switch (ELF32_R_TYPE (internal_relocs->r_info))
{
@@ -2277,7 +2276,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd,
if (!strcmp (current->name, h->root.root.string))
break;
}
- if (!current && !discarded_section (s) && (bfd_get_section_flags (ibfd, s) & SEC_ALLOC))
+ if (!current && !discarded_section (s) && (bfd_section_flags (s) & SEC_ALLOC))
{
/* Will this have an entry in the GOT. */
if (ELF32_R_TYPE (internal_relocs->r_info) == R_LM32_16_GOT)
@@ -2377,7 +2376,7 @@ lm32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
htab->root.splt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
if (bed->want_plt_sym)
@@ -2408,7 +2407,7 @@ lm32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags | SEC_READONLY);
htab->root.srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (htab->root.sgot == NULL
@@ -2447,7 +2446,7 @@ lm32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags | SEC_READONLY);
htab->srelbss = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index b12c788..e3f03cc 100644
--- a/bfd/elf32-m32c.c
+++ b/bfd/elf32-m32c.c
@@ -450,7 +450,7 @@ m32c_elf_relocate_section
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (sym->st_name == 0) ? bfd_section_name (input_bfd, sec) : name;
+ name = sym->st_name == 0 ? bfd_section_name (sec) : name;
}
else
{
@@ -709,7 +709,7 @@ m32c_elf_check_relocs
flags);
elf_hash_table (info)->splt = splt;
if (splt == NULL
- || ! bfd_set_section_alignment (dynobj, splt, 1))
+ || !bfd_set_section_alignment (splt, 1))
return FALSE;
}
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 2f182e7..edd04b9 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -1322,7 +1322,7 @@ _bfd_m32r_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".scommon") == 0)
{
*retval = SHN_M32R_SCOMMON;
return TRUE;
@@ -1407,7 +1407,7 @@ m32r_elf_add_symbol_hook (bfd *abfd,
flags);
if (s == NULL)
return FALSE;
- if (! bfd_set_section_alignment (abfd, s, 2))
+ if (!bfd_set_section_alignment (s, 2))
return FALSE;
}
@@ -1623,7 +1623,7 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
htab->root.splt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
if (bed->want_plt_sym)
@@ -1654,7 +1654,7 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags | SEC_READONLY);
htab->root.srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (htab->root.sgot == NULL
@@ -1693,7 +1693,7 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags | SEC_READONLY);
htab->srelbss = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
@@ -2234,7 +2234,7 @@ m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->root.srelplt)
relocs = TRUE;
@@ -2954,7 +2954,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
const char *name;
BFD_ASSERT (sec != NULL);
- name = bfd_get_section_name (sec->owner, sec);
+ name = bfd_section_name (sec);
if ( strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0
@@ -3022,7 +3022,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (errmsg != NULL)
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 6a99678..8739ca8 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -267,7 +267,7 @@ elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
section != NULL;
section = section->next)
{
- const char* name = bfd_get_section_name (input_bfd, section);
+ const char *name = bfd_section_name (section);
if (!strcmp (name, ".tramp"))
htab->tramp_section = section;
@@ -1014,7 +1014,7 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (is_far && ELF32_R_TYPE (rel->r_info) == R_M68HC11_16)
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 177be5d..559578d 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -3104,7 +3104,7 @@ elf_m68k_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strcmp (name, ".plt") == 0)
{
@@ -3938,7 +3938,7 @@ elf_m68k_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
_bfd_error_handler
@@ -3973,7 +3973,7 @@ elf_m68k_relocate_section (bfd *output_bfd,
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index 7bca458..3a58ff3 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -536,7 +536,7 @@ mcore_elf_relocate_section (bfd * output_bfd,
break;
if (* name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
(*info->callbacks->reloc_overflow)
diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c
index 414e6f3..f46e3bc 100644
--- a/bfd/elf32-mep.c
+++ b/bfd/elf32-mep.c
@@ -477,7 +477,7 @@ mep_elf_relocate_section
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c
index f68f9dc..e3df8c5 100644
--- a/bfd/elf32-metag.c
+++ b/bfd/elf32-metag.c
@@ -1519,7 +1519,7 @@ elf_metag_relocate_section (bfd *output_bfd,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
@@ -2934,7 +2934,7 @@ elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->etab.srelplt)
relocs = TRUE;
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index 8d1700b..c187d83 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -1071,7 +1071,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
/* Only relocate if the symbol is defined. */
if (sec)
{
- name = bfd_get_section_name (sec->owner, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".sdata2") == 0
|| strcmp (name, ".sbss2") == 0)
@@ -1119,7 +1119,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
/* Only relocate if the symbol is defined. */
if (sec)
{
- name = bfd_get_section_name (sec->owner, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0)
@@ -1608,7 +1608,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (errmsg != NULL)
@@ -2766,7 +2766,7 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
if (power_of_two > s->alignment_power)
{
- if (!bfd_set_section_alignment (s->owner, s, power_of_two))
+ if (!bfd_set_section_alignment (s, power_of_two))
return FALSE;
}
@@ -3115,7 +3115,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strncmp (name, ".rela", 5) == 0)
{
@@ -3501,7 +3501,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
put into .sbss. */
*secp = bfd_make_section_old_way (abfd, ".sbss");
if (*secp == NULL
- || ! bfd_set_section_flags (abfd, *secp, SEC_IS_COMMON))
+ || !bfd_set_section_flags (*secp, SEC_IS_COMMON))
return FALSE;
*valp = sym->st_size;
diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c
index 9834d89..9b6048f 100644
--- a/bfd/elf32-moxie.c
+++ b/bfd/elf32-moxie.c
@@ -243,7 +243,7 @@ moxie_elf_relocate_section (bfd *output_bfd,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index fe5fd8f..4dcc8d4 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -1314,7 +1314,7 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL || * name == 0) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL || *name == 0 ? bfd_section_name (sec) : name;
}
else
{
@@ -1691,7 +1691,7 @@ msp430_elf_relax_delete_bytes (bfd * abfd, asection * sec, bfd_vma addr,
name = bfd_elf_string_from_elf_section
(abfd, symtab_hdr->sh_link, isym->st_name);
- name = (name == NULL || * name == 0) ? bfd_section_name (abfd, sec) : name;
+ name = name == NULL || *name == 0 ? bfd_section_name (sec) : name;
if (isym->st_shndx != sec_shndx)
continue;
diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c
index ca6aa13..d120d05 100644
--- a/bfd/elf32-mt.c
+++ b/bfd/elf32-mt.c
@@ -346,7 +346,7 @@ mt_elf_relocate_section
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index 27ffea2..013355a 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -3723,11 +3723,11 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
/* _bfd_elf_create_got_section will create it for us. */
ehtab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
if (ehtab->srelgot == NULL
- || !bfd_set_section_flags (dynobj, ehtab->srelgot,
+ || !bfd_set_section_flags (ehtab->srelgot,
(SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED
| SEC_READONLY))
- || !bfd_set_section_alignment (dynobj, ehtab->srelgot, 2))
+ || !bfd_set_section_alignment (ehtab->srelgot, 2))
return FALSE;
return TRUE;
@@ -3769,8 +3769,8 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
s = bfd_make_section (abfd, ".plt");
ehtab->splt = s;
if (s == NULL
- || !bfd_set_section_flags (abfd, s, pltflags)
- || !bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_flags (s, pltflags)
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
if (bed->want_plt_sym)
@@ -3798,8 +3798,8 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
ehtab->srelplt = s;
if (s == NULL
- || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_flags (s, flags | SEC_READONLY)
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (ehtab->sgot == NULL && !create_got_section (abfd, info))
@@ -3807,11 +3807,11 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
for (sec = abfd->sections; sec; sec = sec->next)
{
- secflags = bfd_get_section_flags[...]
[diff truncated at 100000 bytes]