bfd_section_* macros
authorAlan Modra <amodra@gmail.com>
Mon, 16 Sep 2019 10:55:17 +0000 (20:25 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 19 Sep 2019 00:10:13 +0000 (09:40 +0930)
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.

305 files changed:
bfd/ChangeLog
bfd/aoutx.h
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/bfd.c
bfd/coff-alpha.c
bfd/coff-arm.c
bfd/coff-mips.c
bfd/coff64-rs6000.c
bfd/coffcode.h
bfd/coffgen.c
bfd/cofflink.c
bfd/compress.c
bfd/ecoff.c
bfd/elf-eh-frame.c
bfd/elf-hppa.h
bfd/elf-ifunc.c
bfd/elf-m10200.c
bfd/elf-m10300.c
bfd/elf-properties.c
bfd/elf-s390-common.c
bfd/elf-vxworks.c
bfd/elf.c
bfd/elf32-arc.c
bfd/elf32-arm.c
bfd/elf32-avr.c
bfd/elf32-bfin.c
bfd/elf32-cr16.c
bfd/elf32-cr16c.c
bfd/elf32-cris.c
bfd/elf32-crx.c
bfd/elf32-csky.c
bfd/elf32-d10v.c
bfd/elf32-epiphany.c
bfd/elf32-fr30.c
bfd/elf32-frv.c
bfd/elf32-ft32.c
bfd/elf32-h8300.c
bfd/elf32-hppa.c
bfd/elf32-i386.c
bfd/elf32-ip2k.c
bfd/elf32-iq2000.c
bfd/elf32-lm32.c
bfd/elf32-m32c.c
bfd/elf32-m32r.c
bfd/elf32-m68hc1x.c
bfd/elf32-m68k.c
bfd/elf32-mcore.c
bfd/elf32-mep.c
bfd/elf32-metag.c
bfd/elf32-microblaze.c
bfd/elf32-moxie.c
bfd/elf32-msp430.c
bfd/elf32-mt.c
bfd/elf32-nds32.c
bfd/elf32-nios2.c
bfd/elf32-or1k.c
bfd/elf32-ppc.c
bfd/elf32-pru.c
bfd/elf32-rl78.c
bfd/elf32-rx.c
bfd/elf32-s390.c
bfd/elf32-score.c
bfd/elf32-score7.c
bfd/elf32-sh.c
bfd/elf32-spu.c
bfd/elf32-tic6x.c
bfd/elf32-tilepro.c
bfd/elf32-v850.c
bfd/elf32-vax.c
bfd/elf32-visium.c
bfd/elf32-xstormy16.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-bpf.c
bfd/elf64-hppa.c
bfd/elf64-ia64-vms.c
bfd/elf64-mmix.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-sparc.c
bfd/elf64-x86-64.c
bfd/elflink.c
bfd/elfnn-aarch64.c
bfd/elfnn-ia64.c
bfd/elfnn-riscv.c
bfd/elfxx-aarch64.c
bfd/elfxx-mips.c
bfd/elfxx-sparc.c
bfd/elfxx-tilegx.c
bfd/elfxx-x86.c
bfd/i386msdos.c
bfd/linker.c
bfd/mach-o.c
bfd/mmo.c
bfd/opncls.c
bfd/pdp11.c
bfd/pei-x86_64.c
bfd/peicode.h
bfd/reloc.c
bfd/section.c
bfd/syms.c
bfd/vms-alpha.c
bfd/xcofflink.c
binutils/ChangeLog
binutils/addr2line.c
binutils/bucomm.c
binutils/coffgrok.c
binutils/dlltool.c
binutils/nm.c
binutils/objcopy.c
binutils/objdump.c
binutils/od-elf32_avr.c
binutils/od-macho.c
binutils/od-xcoff.c
binutils/prdbg.c
binutils/rdcoff.c
binutils/rddbg.c
binutils/rescoff.c
binutils/resres.c
binutils/size.c
binutils/srconv.c
binutils/strings.c
binutils/windmc.c
gas/ChangeLog
gas/as.c
gas/as.h
gas/config/obj-coff-seh.c
gas/config/obj-coff.c
gas/config/obj-ecoff.c
gas/config/obj-elf.c
gas/config/obj-macho.c
gas/config/obj-som.c
gas/config/tc-aarch64.c
gas/config/tc-alpha.c
gas/config/tc-arc.c
gas/config/tc-arm.c
gas/config/tc-avr.c
gas/config/tc-bfin.c
gas/config/tc-bpf.c
gas/config/tc-d10v.c
gas/config/tc-d30v.c
gas/config/tc-epiphany.c
gas/config/tc-fr30.c
gas/config/tc-frv.c
gas/config/tc-h8300.c
gas/config/tc-hppa.c
gas/config/tc-i386.c
gas/config/tc-ia64.c
gas/config/tc-ip2k.c
gas/config/tc-iq2000.c
gas/config/tc-lm32.c
gas/config/tc-m32c.c
gas/config/tc-m32r.c
gas/config/tc-m68hc11.c
gas/config/tc-mep.c
gas/config/tc-microblaze.c
gas/config/tc-mips.c
gas/config/tc-mmix.c
gas/config/tc-mn10200.c
gas/config/tc-mn10300.c
gas/config/tc-msp430.c
gas/config/tc-mt.c
gas/config/tc-nds32.c
gas/config/tc-or1k.c
gas/config/tc-ppc.c
gas/config/tc-pru.c
gas/config/tc-rl78.c
gas/config/tc-rx.c
gas/config/tc-s12z.c
gas/config/tc-s390.c
gas/config/tc-score.c
gas/config/tc-score7.c
gas/config/tc-sh.c
gas/config/tc-sparc.c
gas/config/tc-spu.c
gas/config/tc-tic4x.c
gas/config/tc-tic54x.c
gas/config/tc-tic6x.c
gas/config/tc-tilegx.c
gas/config/tc-tilepro.c
gas/config/tc-v850.c
gas/config/tc-visium.c
gas/config/tc-wasm32.c
gas/config/tc-xc16x.c
gas/config/tc-xgate.c
gas/config/tc-xstormy16.c
gas/config/tc-xtensa.c
gas/config/tc-z8k.c
gas/dw2gencfi.c
gas/dwarf2dbg.c
gas/ecoff.c
gas/read.c
gas/stabs.c
gas/subsegs.c
gas/subsegs.h
gas/write.c
gdb/ChangeLog
gdb/aarch64-linux-tdep.c
gdb/arm-tdep.c
gdb/auto-load.c
gdb/cli/cli-dump.c
gdb/coff-pe-read.c
gdb/coffread.c
gdb/compile/compile-object-load.c
gdb/corelow.c
gdb/dbxread.c
gdb/dicos-tdep.c
gdb/dwarf2-frame.c
gdb/dwarf2read.c
gdb/elfread.c
gdb/exec.c
gdb/fbsd-tdep.c
gdb/gcore.c
gdb/gdb_bfd.c
gdb/gdb_bfd.h
gdb/hppa-tdep.c
gdb/i386-cygwin-tdep.c
gdb/i386-fbsd-tdep.c
gdb/i386-linux-tdep.c
gdb/jit.c
gdb/linux-tdep.c
gdb/machoread.c
gdb/maint.c
gdb/mdebugread.c
gdb/mi/mi-interp.c
gdb/minidebug.c
gdb/mips-linux-tdep.c
gdb/mips-sde-tdep.c
gdb/mips-tdep.c
gdb/mipsread.c
gdb/nto-tdep.c
gdb/objfiles.c
gdb/objfiles.h
gdb/osabi.c
gdb/ppc-linux-tdep.c
gdb/ppc64-tdep.c
gdb/record-btrace.c
gdb/record-full.c
gdb/remote.c
gdb/rs6000-aix-tdep.c
gdb/rs6000-tdep.c
gdb/s390-linux-tdep.c
gdb/s390-tdep.c
gdb/solib-aix.c
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/solib-spu.c
gdb/solib-svr4.c
gdb/solib-target.c
gdb/spu-linux-nat.c
gdb/spu-tdep.c
gdb/symfile-mem.c
gdb/symfile.c
gdb/symmisc.c
gdb/symtab.c
gdb/target.c
gdb/windows-nat.c
gdb/xcoffread.c
gprof/ChangeLog
gprof/corefile.c
gprof/symtab.c
ld/ChangeLog
ld/emultempl/aarch64elf.em
ld/emultempl/aix.em
ld/emultempl/armcoff.em
ld/emultempl/armelf.em
ld/emultempl/cr16elf.em
ld/emultempl/cskyelf.em
ld/emultempl/m68hc1xelf.em
ld/emultempl/m68kelf.em
ld/emultempl/mipself.em
ld/emultempl/mmix-elfnmmo.em
ld/emultempl/mmo.em
ld/emultempl/msp430.em
ld/emultempl/nios2elf.em
ld/emultempl/pe.em
ld/emultempl/pep.em
ld/emultempl/ppc64elf.em
ld/emultempl/xtensaelf.em
ld/ldcref.c
ld/ldctor.c
ld/ldelf.c
ld/ldlang.c
ld/pe-dll.c
libctf/ChangeLog
libctf/ctf-open-bfd.c
opcodes/ChangeLog
opcodes/arc-ext.c
sim/ChangeLog
sim/common/sim-load.c
sim/common/sim-utils.c
sim/cris/sim-if.c
sim/erc32/func.c
sim/lm32/sim-if.c
sim/m32c/load.c
sim/m32c/trace.c
sim/m68hc11/interp.c
sim/ppc/hw_htab.c
sim/ppc/hw_init.c
sim/rl78/load.c
sim/rl78/trace.c
sim/rx/gdb-if.c
sim/rx/load.c
sim/rx/trace.c

index 63f6c4c33ff98be15fe1ced8aea49fdfb3a7e187..8fff6a67523d9920b4c2cb3d21f2fd7796ecb4da 100644 (file)
@@ -1,3 +1,48 @@
+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.
index 859153be1000fdbae96d595f2b7eb5013e020214..8923ca7b3cbfb6190ef89021935b887979a71ecf 100644 (file)
@@ -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
index 5a303443501902af4c0e016d351e8234fb9795a6..e55e3e90ba7f8983515c585d6c5bb4154ed11ddd 100644 (file)
@@ -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  \
index 6542d403e06ddd79659b08e3b177ba393cfdf95a..425f0c6709af6ebe806c9e60b95e5e6ff75cad96 100644 (file)
@@ -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,
index c973c780b40f7ec4e42f6b5f974bd0504aca7ca8..7029bf7b85bac4543a915970c04d78524ab8be9c 100644 (file)
--- 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);
index ee4a3eeded70f66e1d786e35e582839b75c8436d..d36921bbfe6784523bbbd533ccfdbfa93fe9d701 100644 (file)
@@ -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,
index 5237bfb2d08870cd692c64ab9176b0a68bc85c78..cbc5257e9f3e951a5ed46aa92336426ef0aee07c 100644 (file)
@@ -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;
     }
 
index a2dd9e1c4fc10edde468d55eb832e0ca80c0e1e2..c6fe679a6c68e56cdf02a9b1464b068c62fa8773 100644 (file)
@@ -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,
index 1c80a9df8851c39c3a1459320d299f11c9e4fca2..091da1fd5e81e5fa5a1480221b1e12deaffe5e82 100644 (file)
@@ -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
        {
index dd3189fbd3d4b1f002c092fa5891d22c392e8525..948bb705b0945ff749383a1ee7ffc55bb4221f81 100644 (file)
@@ -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
index 80a9a2ab9ae6ce2d8905c0b51922f4104205507c..ba7bb5eaf42573668eedb8289816e721a129d928 100644 (file)
@@ -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)
index 7bcc1ca77da436f38ce46a3606605e8f0374bac9..2115e9c36ab0990b83e59636a520bc957186ef3a 100644 (file)
@@ -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);
index 32de09923df42fa53c400a2da62b5dc527e40019..8f96d064bde1369a8956a3d3ed9d8599b86ead86 100644 (file)
@@ -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;
index c06fa5ec7f99eddf53c84a05f39b5e5a0624d915..30adba0e6d2bff32c2cfd602c41564107108e8aa 100644 (file)
@@ -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))
index 6919ac3031bedf8b9748f643ddcdbfc7d0ffe8a2..c2cb77bb1103b3fdd34eb916bb1f4a43f435d745 100644 (file)
@@ -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))
index cc98caeeb0b60984278a08bea066f9a9082404fd..2035d4c9c0b12a6dc15bbc016fee9274d0b7d662 100644 (file)
@@ -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)
     {
index 89054e439a108e5bd723258b37691c822e7f5d1c..58948e32f112787c7afa9da42d2306541a90c56b 100644 (file)
@@ -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;
     }
index cfccb968670c6d6e89bc03a847794c0346c89ba2..b234c168c8f1b5ec666f04a95f45bd1f7d9b0fb4 100644 (file)
@@ -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)
index acc3c54258eee10ddd98e7df51a100d6a45061a8..30828f117ab17b72a39133125009e5423d50b9b9 100644 (file)
@@ -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
index 198eece084346589c04057ea1f672487818cf85a..199e61728e418f3b1fdb437ef11152b3cb67930b 100644 (file)
@@ -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);
index ef8abeb2d07fc6de26274ee6d1e20781d400c812..d7cd7e60e9e376599268daf1f1c0ff1dc53ac160 100644 (file)
@@ -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;
 
index a7f574c2ef722124967b2d5a3f0c7b9704c2bb3b..8fe17bf628fdea9be2c49c4017758bbbca26d2f6 100644 (file)
@@ -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:
index 1a1eed908573d1b616cd20083289fd9a8c16a217..664eae5c66f6beeec4d6f64ea66b8ef20214cc31 100644 (file)
--- 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,
index 493f32dad7f0875df4df58e991559048736e5d68..91537efd8410dde9bc51b0e9071323f4c7a93026 100644 (file)
@@ -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;
index e29a60abf19557f12834a4a3d98d4e44074f6e56..1c4887a03408ce0c019151911a958a907f1e6b2f 100644 (file)
@@ -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;
index e75ac9fc1dbb9d56b6b703d57b49af1cee7b1b19..f04cc94ff3456e0d97dcc2e3cbbcab3e5fa0c789 100644 (file)
@@ -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);
index d73bfdaee399325858ca7468b80e447ce93d02a8..6efee04c8bb024fa9555dc616af7d74474e0dab5 100644 (file)
@@ -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;
 
index 7d0a0e558f1461db423e3447dd8bac88bbac200a..72642e532c197bc5fdb2bafed4b5db8a83636ad9 100644 (file)
@@ -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
index 9a2fda0ea8e60caf46bf7842fe22ad8da21011fc..35bacbbc6faeebc5cda9e76cdf6c40104e63fe66 100644 (file)
@@ -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;
index 5d230562a5cefe39da657f4193b9f036b1ec2e4a..9c07b6d7b9871403fdfff41fa55807ba77f382c0 100644 (file)
@@ -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)
        {
index 306a0e4f2b288797f4890447a7c4e39b0b32d7ff..6d15b2b10bfb77b112a0c7558c5906b3a5b6a466 100644 (file)
@@ -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)
index b3451b60b217720e9ce4bb5fcf0d1d34fd4812f0..16897b3930e758ef7a9252180a13516ff645104d 100644 (file)
@@ -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,
index a03ce632868ef6b4bbaadec8cc2753012010a4bb..bd07ad68b2844577606d926baa280b62227dc913 100644 (file)
@@ -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,
index 4bd417d6f50bef73b72910eef2532b4111810c0a..c45f0b35042877cc051ffe5984ac2887f101637a 100644 (file)
@@ -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
        {
index 6a13767c7ae6a7f1271b16116e92084d3892c0bc..0d299c64b616ea2e64a832440a00336fdd829a36 100644 (file)
@@ -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
        {
index 8c6a97dea26f4789d90b3b32547d77feb8126dbb..7770687f55781a9bb1d8e04121f73c1ae6551567 100644 (file)
@@ -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;
 
index d67372429de70bec5a98581dce016210dc8abf30..b8e69e5a2484b24312ab1bd9d4473280a2022e84 100644 (file)
@@ -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
        {
index a2f06d5a9285f8b3bfdeb45fc23c8878c463e5ef..ba7c8b2062d98280e4d35bb63982b4daf4aa00a2 100644 (file)
@@ -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)
index a61adbc3c8995b015cbe9a0faeadf93f350f6e58..f065449b15ec97f3c6486c67d59606f807ef6d37 100644 (file)
@@ -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;
index d7a61d7a481caff10e6065a05a5cb98c168ef779..9248ef5a41803b8de7b8c79869f710f7864bc3ac 100644 (file)
@@ -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)
index 43e7be63dad2b1e3640f159f4bee20d044ef984b..6e5131ff98be74276a230c2e538bc134fba548df 100644 (file)
@@ -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
        {
index 6e470272929a7085f63a45a4dae2fc11bc689a97..e95f1a56eacd332f50762d41769e60ba83771710 100644 (file)
@@ -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
        {
index 5233dbbb67c94cb000ca0368e75598349e08a493..0601f1454b48968ebd050ef46a7cf6da582ddc70 100644 (file)
@@ -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;
        }
     }
index b12c788c0df6e6213a7b7df85efcff0d60ca2946..e3f03cc045adf70b740dd237f6423a5061991543 100644 (file)
@@ -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;
            }
 
index 2f182e782d266e22bbb4c55fe1cd49e320728fa8..edd04b91d9d771472c2cd05368bb1f5b0063ebae 100644 (file)
@@ -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)
index 6a996789b5bbf0fb9f030fe6605b09a9c0d6653e..8739ca86c13a4810f0c1d22ea4938e5c6613f47d 100644 (file)
@@ -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)
index 177be5d1d39bbfa78036f5d694fe134dfb0c752d..559578d81827ea538571fddf2d94d91875a0f5b5 100644 (file)
@@ -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)
index 7bca45850898d31570cc468df419b66559ce8744..3a58ff3038be35c4522e39aba5b2eccab18fa514 100644 (file)
@@ -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)
index 414e6f394b7b8615e658751c4b1302b5c401ae75..f46e3bcbe36e633217592da5d7bf28a68129f554 100644 (file)
@@ -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
        {
index f68f9dca6f80098f498c043b89fa940b0d1af4c1..e3df8c56843bf83d4e65b78cd25fd93c39651b70 100644 (file)
@@ -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;
index 8d1700bf0f0bcd4d5de763eefe7b735e1a258bbe..c187d83ee046a26265c96cac393299190c62c952 100644 (file)
@@ -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;
index 9834d8978fd6191d91e06a82afc74d3230acc2fe..9b6048f0c0054b06bc442962b51ff1119b0004b4 100644 (file)
@@ -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
        {
index fe5fd8ff8c109467be5e8b385a89089a4f2faa3b..4dcc8d480da870c4f263b45cbccd3803a2d4227d 100644 (file)
@@ -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;
index ca6aa13f195cb3f7b1f371cc6d80497a947320ed..d120d0548285920ac5fd06868d77aee34ffcbd88 100644 (file)
@@ -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
        {
index 27ffea2e69284b12c63725cdb6ac77dcb8ab5d4e..013355a490802f446e016dfe4f52f7731bf5f9b3 100644 (file)
@@ -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 (abfd, sec);
+      secflags = bfd_section_flags (sec);
       if ((secflags & (SEC_DATA | SEC_LINKER_CREATED))
          || ((secflags & SEC_HAS_CONTENTS) != SEC_HAS_CONTENTS))
        continue;
-      secname = bfd_get_section_name (abfd, sec);
+      secname = bfd_section_name (sec);
       relname = (char *) bfd_malloc ((bfd_size_type) strlen (secname) + 6);
       strcpy (relname, ".rela");
       strcat (relname, secname);
@@ -3819,8 +3819,8 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
        continue;
       s = bfd_make_section (abfd, relname);
       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;
     }
 
@@ -3835,7 +3835,7 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section (abfd, ".dynbss");
       htab->sdynbss = s;
       if (s == NULL
-         || !bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED))
+         || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED))
        return FALSE;
       /* The .rel[a].bss section holds copy relocs.  This section is not
         normally needed.  We need to create it here, though, so that the
@@ -3854,8 +3854,8 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
                                       ? ".rela.bss" : ".rel.bss"));
          htab->srelbss = 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;
        }
     }
@@ -4065,9 +4065,9 @@ nds32_elf_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;
     }
 
@@ -4525,7 +4525,7 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
        {
          got_size += s->size;
        }
-      else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
+      else if (strncmp (bfd_section_name (s), ".rela", 5) == 0)
        {
          if (s->size != 0 && s != elf_hash_table (info)->srelplt)
            relocs = TRUE;
@@ -5571,8 +5571,7 @@ nds32_elf_relocate_section (bfd *            output_bfd ATTRIBUTE_UNUSED,
                    return FALSE;
 
                  BFD_ASSERT (strncmp (name, ".rela", 5) == 0
-                             && strcmp (bfd_get_section_name (input_bfd,
-                                                              input_section),
+                             && strcmp (bfd_section_name (input_section),
                                         name + 5) == 0);
 
                  sreloc = bfd_get_section_by_name (dynobj, name);
@@ -6166,7 +6165,7 @@ check_reloc:
              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)
@@ -7390,7 +7389,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                    return FALSE;
 
                  BFD_ASSERT (strncmp (name, ".rela", 5) == 0
-                             && strcmp (bfd_get_section_name (abfd, sec),
+                             && strcmp (bfd_section_name (sec),
                                         name + 5) == 0);
 
                  sreloc = bfd_get_section_by_name (dynobj, name);
@@ -7404,8 +7403,8 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                      if ((sec->flags & SEC_ALLOC) != 0)
                        flags |= SEC_ALLOC | SEC_LOAD;
                      if (sreloc == NULL
-                         || !bfd_set_section_flags (dynobj, sreloc, flags)
-                         || !bfd_set_section_alignment (dynobj, sreloc, 2))
+                         || !bfd_set_section_flags (sreloc, flags)
+                         || !bfd_set_section_alignment (sreloc, 2))
                        return FALSE;
 
                      elf_section_type (sreloc) = SHT_RELA;
index 5d787eb2f4010692fe23121eb8f73e6d60cd8278..698e4e5c2d41477a365d4ba02fc69a24659c5f80 100644 (file)
@@ -3846,7 +3846,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
                                  (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);
                        }
                      /* xgettext:c-format */
                      format = _("unable to reach %s (at %#" PRIx64 ") from "
@@ -4484,7 +4484,7 @@ nios2_elf32_relocate_section (bfd *output_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)
@@ -4554,7 +4554,7 @@ static bfd_boolean
 nios2_elf32_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
                           Elf_Internal_Shdr *hdr, asection *sec)
 {
-  register const char *name = bfd_get_section_name (abfd, sec);
+  const char *name = bfd_section_name (sec);
 
   if ((sec->flags & SEC_SMALL_DATA)
       || strcmp (name, ".sdata") == 0
@@ -4580,7 +4580,7 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
 
   /* In order for the two loads in .PLTresolve to share the same %hiadj,
      _GLOBAL_OFFSET_TABLE_ must be aligned to a 16-byte boundary.  */
-  if (!bfd_set_section_alignment (dynobj, htab->root.sgotplt, 4))
+  if (!bfd_set_section_alignment (htab->root.sgotplt, 4))
     return FALSE;
 
   /* The Nios II ABI specifies that GOT-relative relocations are relative
@@ -4616,7 +4616,7 @@ nios2_elf32_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
      same %hiadj, the start of the PLT (as well as the GOT) must be aligned
      to a 16-byte boundary.  This is because the addresses for these loads
      include the -(.plt+4) PIC correction.  */
-  return bfd_set_section_alignment (dynobj, htab->root.splt, 4);
+  return bfd_set_section_alignment (htab->root.splt, 4);
 }
 
 /* Implement elf_backend_copy_indirect_symbol:
@@ -5429,8 +5429,8 @@ nios2_elf32_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* Align dynbss.  */
   s->size = BFD_ALIGN (s->size, (bfd_size_type)1 << align2);
-  if (align2 > bfd_get_section_alignment (dynobj, s)
-      && !bfd_set_section_alignment (dynobj, s, align2))
+  if (align2 > bfd_section_alignment (s)
+      && !bfd_set_section_alignment (s, align2))
     return FALSE;
 
   /* Define the symbol as being at this point in the section.  */
@@ -5853,7 +5853,7 @@ nios2_elf32_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 (CONST_STRNEQ (name, ".rela"))
        {
index 0d1336ceaccdc2a861c9bbb45b20c0931df0e0d2..4cf0b7cc36ce307b50293a70d29366cb1fdc1fea 100644 (file)
@@ -1303,7 +1303,7 @@ or1k_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
        {
@@ -2064,8 +2064,7 @@ or1k_elf_check_relocs (bfd *abfd,
                      return FALSE;
 
                    if (strncmp (name, ".rela", 5) != 0
-                       || strcmp (bfd_get_section_name (abfd, sec),
-                                  name + 5) != 0)
+                       || strcmp (bfd_section_name (sec), name + 5) != 0)
                      {
                        _bfd_error_handler
                          /* xgettext:c-format */
@@ -2996,7 +2995,7 @@ or1k_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;
index 5e5834a70ca9f5bcbd3e718b4c57e16465568d3e..9765a33541f1f18a7713930fad9f17755cf0d267 100644 (file)
@@ -1329,14 +1329,14 @@ ppc_elf_section_from_shdr (bfd *abfd,
     return FALSE;
 
   newsect = hdr->bfd_section;
-  flags = bfd_get_section_flags (abfd, newsect);
+  flags = bfd_section_flags (newsect);
   if (hdr->sh_flags & SHF_EXCLUDE)
     flags |= SEC_EXCLUDE;
 
   if (hdr->sh_type == SHT_ORDERED)
     flags |= SEC_SORT_ENTRIES;
 
-  bfd_set_section_flags (abfd, newsect, flags);
+  bfd_set_section_flags (newsect, flags);
   return TRUE;
 }
 
@@ -1674,7 +1674,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info)
       /* Set the output section size, if it exists.  */
       asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME);
 
-      if (asec && ! bfd_set_section_size (abfd, asec, 20 + num_entries * 4))
+      if (asec && !bfd_set_section_size (asec, 20 + num_entries * 4))
        {
          ibfd = abfd;
          /* xgettext:c-format */
@@ -2337,7 +2337,7 @@ ppc_elf_create_got (bfd *abfd, struct bfd_link_info *info)
         executable.  */
       flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS
                        | SEC_IN_MEMORY | SEC_LINKER_CREATED);
-      if (!bfd_set_section_flags (abfd, htab->elf.sgot, flags))
+      if (!bfd_set_section_flags (htab->elf.sgot, flags))
        return FALSE;
     }
 
@@ -2390,7 +2390,7 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
   if (p2align < htab->params->plt_stub_align)
     p2align = htab->params->plt_stub_align;
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, p2align))
+      || !bfd_set_section_alignment (s, p2align))
     return FALSE;
 
   if (!info->no_ld_generated_unwind_info)
@@ -2400,7 +2400,7 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section_anyway_with_flags (abfd, ".eh_frame", flags);
       htab->glink_eh_frame = s;
       if (s == NULL
-         || !bfd_set_section_alignment (abfd, s, 2))
+         || !bfd_set_section_alignment (s, 2))
        return FALSE;
     }
 
@@ -2408,7 +2408,7 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
   s = bfd_make_section_anyway_with_flags (abfd, ".iplt", flags);
   htab->elf.iplt = s;
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 4))
+      || !bfd_set_section_alignment (s, 4))
     return FALSE;
 
   flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS
@@ -2416,7 +2416,7 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
   s = bfd_make_section_anyway_with_flags (abfd, ".rela.iplt", flags);
   htab->elf.irelplt = s;
   if (s == NULL
-      || ! bfd_set_section_alignment (abfd, s, 2))
+      || ! bfd_set_section_alignment (s, 2))
     return FALSE;
 
   /* Local plt entries.  */
@@ -2425,7 +2425,7 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
   htab->pltlocal = bfd_make_section_anyway_with_flags (abfd, ".branch_lt",
                                                       flags);
   if (htab->pltlocal == NULL
-      || ! bfd_set_section_alignment (abfd, htab->pltlocal, 2))
+      || !bfd_set_section_alignment (htab->pltlocal, 2))
     return FALSE;
 
   if (bfd_link_pic (info))
@@ -2435,7 +2435,7 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
       htab->relpltlocal
        = bfd_make_section_anyway_with_flags (abfd, ".rela.branch_lt", flags);
       if (htab->relpltlocal == NULL
-         || ! bfd_set_section_alignment (abfd, htab->relpltlocal, 2))
+         || !bfd_set_section_alignment (htab->relpltlocal, 2))
        return FALSE;
     }
 
@@ -2487,7 +2487,7 @@ ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section_anyway_with_flags (abfd, ".rela.sbss", flags);
       htab->relsbss = s;
       if (s == NULL
-         || ! bfd_set_section_alignment (abfd, s, 2))
+         || !bfd_set_section_alignment (s, 2))
        return FALSE;
     }
 
@@ -2500,7 +2500,7 @@ ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   if (htab->plt_type == PLT_VXWORKS)
     /* The VxWorks PLT is a loaded section with contents.  */
     flags |= SEC_HAS_CONTENTS | SEC_LOAD | SEC_READONLY;
-  return bfd_set_section_flags (abfd, s, flags);
+  return bfd_set_section_flags (s, flags);
 }
 
 /* Copy the extra info we tack onto an elf_link_hash_entry.  */
@@ -2739,7 +2739,7 @@ elf_allocate_pointer_linker_section (bfd *abfd,
   linker_section_ptr->lsect = lsect;
   *ptr_linker_section_ptr = linker_section_ptr;
 
-  if (!bfd_set_section_alignment (lsect->section->owner, lsect->section, 2))
+  if (!bfd_set_section_alignment (lsect->section, 2))
     return FALSE;
   linker_section_ptr->offset = lsect->section->size;
   lsect->section->size += 4;
@@ -4029,19 +4029,19 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED,
 
       /* The new PLT is a loaded section.  */
       if (htab->elf.splt != NULL
-         && !bfd_set_section_flags (htab->elf.dynobj, htab->elf.splt, flags))
+         && !bfd_set_section_flags (htab->elf.splt, flags))
        return -1;
 
       /* The new GOT is not executable.  */
       if (htab->elf.sgot != NULL
-         && !bfd_set_section_flags (htab->elf.dynobj, htab->elf.sgot, flags))
+         && !bfd_set_section_flags (htab->elf.sgot, flags))
        return -1;
     }
   else
     {
       /* Stop an unused .glink section from affecting .text alignment.  */
       if (htab->glink != NULL
-         && !bfd_set_section_alignment (htab->elf.dynobj, htab->glink, 0))
+         && !bfd_set_section_alignment (htab->glink, 0))
        return -1;
     }
   return htab->plt_type == PLT_NEW;
@@ -5823,8 +5823,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd,
        {
          strip_section = (s->flags & SEC_KEEP) == 0;
        }
-      else if (CONST_STRNEQ (bfd_get_section_name (htab->elf.dynobj, s),
-                            ".rela"))
+      else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
        {
          if (s->size != 0)
            {
@@ -8394,10 +8393,8 @@ ppc_elf_relocate_section (bfd *output_bfd,
              unresolved_reloc = TRUE;
              break;
            }
-         BFD_ASSERT (strcmp (bfd_get_section_name (sec->owner, sec),
-                             ".got") == 0
-                     || strcmp (bfd_get_section_name (sec->owner, sec),
-                                ".cgot") == 0);
+         BFD_ASSERT (strcmp (bfd_section_name (sec), ".got") == 0
+                     || strcmp (bfd_section_name (sec), ".cgot") == 0);
 
          addend -= sec->output_section->vma + sec->output_offset + 0x8000;
          break;
@@ -8512,7 +8509,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
              }
            addend -= SYM_VAL (sda);
 
-           name = bfd_get_section_name (output_bfd, sec->output_section);
+           name = bfd_section_name (sec->output_section);
            if (!(strcmp (name, ".sdata") == 0
                  || strcmp (name, ".sbss") == 0))
              {
@@ -8543,7 +8540,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
              }
            addend -= SYM_VAL (sda);
 
-           name = bfd_get_section_name (output_bfd, sec->output_section);
+           name = bfd_section_name (sec->output_section);
            if (!(strcmp (name, ".sdata2") == 0
                  || strcmp (name, ".sbss2") == 0))
              {
@@ -8618,7 +8615,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
                break;
              }
 
-           name = bfd_get_section_name (output_bfd, sec->output_section);
+           name = bfd_section_name (sec->output_section);
            if (strcmp (name, ".sdata") == 0
                || strcmp (name, ".sbss") == 0)
              {
@@ -8725,7 +8722,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
                break;
              }
 
-           name = bfd_get_section_name (output_bfd, sec->output_section);
+           name = bfd_section_name (sec->output_section);
            if (strcmp (name, ".sdata") == 0
                || strcmp (name, ".sbss") == 0)
              sda = htab->sdata[0].sym;
index d9be74f9163074fd975c979a34e90a2b2fb53d72..054f1650f264a5930d4338a917c846bc4ff9b28d 100644 (file)
@@ -905,7 +905,7 @@ pru_elf32_relocate_section (bfd *output_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)
index 8fa7ea30be3e9143b72718fda248714e5cb41de5..ba95515f7d51fc2b71b29de9b1ef819daaa657aa 100644 (file)
@@ -726,7 +726,7 @@ rl78_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
        {
@@ -1349,7 +1349,7 @@ rl78_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;
            }
 
index e130784bc8f18b06e6250aed4add39b23614a317..7978244f1e5a81ac280a8cb468e33b163c460c3d 100644 (file)
@@ -543,7 +543,7 @@ rx_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
        {
index 7bdccdbef982f3d491fa94c412648407e7fac76f..7e22d9666ab2b4a11960e6c291d446b6ecbff8bf 100644 (file)
@@ -2003,7 +2003,7 @@ elf_s390_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)
            relocs = TRUE;
@@ -3254,7 +3254,7 @@ elf_s390_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)
index 1bbf64fe6dc6b537a479df4555d2c6a63dd547d5..3d499ca07190adab387900cac7b5bc95634cacf4 100644 (file)
@@ -1257,8 +1257,8 @@ score_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p)
                                                    | SEC_LINKER_CREATED
                                                    | SEC_READONLY));
       if (sreloc == NULL
-         || ! bfd_set_section_alignment (dynobj, sreloc,
-                                         SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
+         || !bfd_set_section_alignment (sreloc,
+                                        SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
        return NULL;
     }
   return sreloc;
@@ -1431,7 +1431,7 @@ score_elf_create_got_section (bfd *abfd,
   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, 4))
+      || !bfd_set_section_alignment (s, 4))
     return FALSE;
 
   /* Define the symbol _GLOBAL_OFFSET_TABLE_.  We don't do this in the
@@ -3070,7 +3070,7 @@ s3_bfd_score_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_SCORE_SCOMMON;
       return TRUE;
@@ -3283,7 +3283,7 @@ s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
 
       /* 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 (CONST_STRNEQ (name, ".rel"))
        {
@@ -3296,8 +3296,7 @@ s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
                 the linker now does not create empty output sections.  */
              if (s->output_section != NULL
                  && strcmp (name,
-                            bfd_get_section_name (s->output_section->owner,
-                                                  s->output_section)) == 0)
+                            bfd_section_name (s->output_section)) == 0)
                s->flags |= SEC_EXCLUDE;
            }
          else
@@ -3311,7 +3310,7 @@ s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
                 assert a DT_TEXTREL entry rather than testing whether
                 there exists a relocation to a read only section or
                 not.  */
-             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 + 4);
              if ((target != NULL
                   && (target->flags & SEC_READONLY) != 0
@@ -3424,7 +3423,7 @@ s3_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   s = bfd_get_linker_section (abfd, ".dynamic");
   if (s != NULL)
     {
-      if (!bfd_set_section_flags (abfd, s, flags))
+      if (!bfd_set_section_flags (s, flags))
        return FALSE;
     }
 
@@ -3441,7 +3440,7 @@ s3_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section_anyway_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME,
                                              flags | SEC_CODE);
       if (s == NULL
-         || !bfd_set_section_alignment (abfd, s, 2))
+         || !bfd_set_section_alignment (s, 2))
 
        return FALSE;
     }
@@ -3709,7 +3708,7 @@ s3_bfd_score_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
 {
   const char *name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (strcmp (name, ".got") == 0
       || strcmp (name, ".srdata") == 0
@@ -3732,7 +3731,7 @@ s3_bfd_score_elf_section_processing (bfd *abfd ATTRIBUTE_UNUSED, Elf_Internal_Sh
 {
   if (hdr->bfd_section != NULL)
     {
-      const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+      const char *name = bfd_section_name (hdr->bfd_section);
 
       if (strcmp (name, ".sdata") == 0)
        {
index 51a5fb106d7559c46660dfa9e8b72cf052c07391..e625435ff574903adb227e14fd471122d420552c 100644 (file)
@@ -1114,8 +1114,8 @@ score_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p)
                                                    | SEC_LINKER_CREATED
                                                    | SEC_READONLY));
       if (sreloc == NULL
-         || ! bfd_set_section_alignment (dynobj, sreloc,
-                                         SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
+         || !bfd_set_section_alignment (sreloc,
+                                        SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
        return NULL;
     }
   return sreloc;
@@ -1289,7 +1289,7 @@ score_elf_create_got_section (bfd *abfd,
   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, 4))
+      || !bfd_set_section_alignment (s, 4))
     return FALSE;
 
   /* Define the symbol _GLOBAL_OFFSET_TABLE_.  We don't do this in the
@@ -2875,7 +2875,7 @@ s7_bfd_score_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_SCORE_SCOMMON;
       return TRUE;
@@ -3091,7 +3091,7 @@ s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
 
       /* 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 (CONST_STRNEQ (name, ".rel"))
        {
@@ -3104,8 +3104,7 @@ s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
                 the linker now does not create empty output sections.  */
              if (s->output_section != NULL
                  && strcmp (name,
-                            bfd_get_section_name (s->output_section->owner,
-                                                  s->output_section)) == 0)
+                            bfd_section_name (s->output_section)) == 0)
                s->flags |= SEC_EXCLUDE;
            }
          else
@@ -3119,7 +3118,7 @@ s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
                 assert a DT_TEXTREL entry rather than testing whether
                 there exists a relocation to a read only section or
                 not.  */
-             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 + 4);
              if ((target != NULL
                   && (target->flags & SEC_READONLY) != 0
@@ -3232,7 +3231,7 @@ s7_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   s = bfd_get_linker_section (abfd, ".dynamic");
   if (s != NULL)
     {
-      if (!bfd_set_section_flags (abfd, s, flags))
+      if (!bfd_set_section_flags (s, flags))
        return FALSE;
     }
 
@@ -3249,7 +3248,7 @@ s7_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section_anyway_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME,
                                              flags | SEC_CODE);
       if (s == NULL
-         || !bfd_set_section_alignment (abfd, s, 2))
+         || !bfd_set_section_alignment (s, 2))
 
        return FALSE;
     }
@@ -3520,7 +3519,7 @@ s7_bfd_score_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
 {
   const char *name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (strcmp (name, ".got") == 0
       || strcmp (name, ".srdata") == 0
@@ -3544,7 +3543,7 @@ s7_bfd_score_elf_section_processing (bfd *abfd ATTRIBUTE_UNUSED, Elf_Internal_Sh
 {
   if (hdr->bfd_section != NULL)
     {
-      const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+      const char *name = bfd_section_name (hdr->bfd_section);
 
       if (strcmp (name, ".sdata") == 0)
        {
index 91900b8bea3d2efabcee55742b03aae4f6c8b7bc..c572f709f2a17b53d5f5d42faf8b30632d09842c 100644 (file)
@@ -2324,7 +2324,7 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
                                                         | SEC_IN_MEMORY
                                                         | SEC_LINKER_CREATED));
   if (htab->sfuncdesc == NULL
-      || ! bfd_set_section_alignment (dynobj, htab->sfuncdesc, 2))
+      || !bfd_set_section_alignment (htab->sfuncdesc, 2))
     return FALSE;
 
   htab->srelfuncdesc = bfd_make_section_anyway_with_flags (dynobj,
@@ -2335,7 +2335,7 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
                                                            | SEC_LINKER_CREATED
                                                            | SEC_READONLY));
   if (htab->srelfuncdesc == NULL
-      || ! bfd_set_section_alignment (dynobj, htab->srelfuncdesc, 2))
+      || !bfd_set_section_alignment (htab->srelfuncdesc, 2))
     return FALSE;
 
   /* Also create .rofixup.  */
@@ -2346,7 +2346,7 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
                                                        | SEC_LINKER_CREATED
                                                        | SEC_READONLY));
   if (htab->srofixup == NULL
-      || ! bfd_set_section_alignment (dynobj, htab->srofixup, 2))
+      || !bfd_set_section_alignment (htab->srofixup, 2))
     return FALSE;
 
   return TRUE;
@@ -2401,7 +2401,7 @@ sh_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)
@@ -2433,7 +2433,7 @@ sh_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
@@ -2473,7 +2473,7 @@ sh_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;
        }
     }
@@ -3211,7 +3211,7 @@ sh_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 && s != htab->srelplt2)
            relocs = TRUE;
@@ -3619,7 +3619,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
          symname = bfd_elf_string_from_elf_section
            (input_bfd, symtab_hdr->sh_link, sym->st_name);
          if (symname == NULL || *symname == '\0')
-           symname = bfd_section_name (input_bfd, sec);
+           symname = bfd_section_name (sec);
 
          relocation = (sec->output_section->vma
                        + sec->output_offset
@@ -5170,7 +5170,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                    if (name == NULL)
                      return FALSE;
                    if (*name == '\0')
-                     name = bfd_section_name (input_bfd, sec);
+                     name = bfd_section_name (sec);
                  }
                (*info->callbacks->reloc_overflow)
                  (info, (h ? &h->root : NULL), name, howto->name,
index f66e37cd00ae60b68c23c615d604b4e68e14f211..e75d999fd51fa12bb5e3b53eb18e7f7390a01211 100644 (file)
@@ -585,7 +585,7 @@ spu_elf_create_sections (struct bfd_link_info *info)
       flags = SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
       s = bfd_make_section_anyway_with_flags (ibfd, SPU_PTNOTE_SPUNAME, flags);
       if (s == NULL
-         || !bfd_set_section_alignment (ibfd, s, 4))
+         || !bfd_set_section_alignment (s, 4))
        return FALSE;
       /* Because we didn't set SEC_LINKER_CREATED we need to set the
         proper section type.  */
@@ -595,7 +595,7 @@ spu_elf_create_sections (struct bfd_link_info *info)
       size = 12 + ((sizeof (SPU_PLUGIN_NAME) + 3) & -4);
       size += (name_len + 3) & -4;
 
-      if (!bfd_set_section_size (ibfd, s, size))
+      if (!bfd_set_section_size (s, size))
        return FALSE;
 
       data = bfd_zalloc (ibfd, size);
@@ -622,7 +622,7 @@ spu_elf_create_sections (struct bfd_link_info *info)
       flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY | SEC_HAS_CONTENTS
               | SEC_IN_MEMORY | SEC_LINKER_CREATED);
       s = bfd_make_section_anyway_with_flags (ibfd, ".fixup", flags);
-      if (s == NULL || !bfd_set_section_alignment (ibfd, s, 2))
+      if (s == NULL || !bfd_set_section_alignment (s, 2))
        return FALSE;
       htab->sfixup = s;
     }
@@ -1694,7 +1694,7 @@ spu_elf_size_stubs (struct bfd_link_info *info)
       stub = bfd_make_section_anyway_with_flags (ibfd, ".stub", flags);
       htab->stub_sec[0] = stub;
       if (stub == NULL
-         || !bfd_set_section_alignment (ibfd, stub,
+         || !bfd_set_section_alignment (stub,
                                         ovl_stub_size_log2 (htab->params)))
        return 0;
       stub->size = htab->stub_count[0] * ovl_stub_size (htab->params);
@@ -1709,7 +1709,7 @@ spu_elf_size_stubs (struct bfd_link_info *info)
          stub = bfd_make_section_anyway_with_flags (ibfd, ".stub", flags);
          htab->stub_sec[ovl] = stub;
          if (stub == NULL
-             || !bfd_set_section_alignment (ibfd, stub,
+             || !bfd_set_section_alignment (stub,
                                             ovl_stub_size_log2 (htab->params)))
            return 0;
          stub->size = htab->stub_count[ovl] * ovl_stub_size (htab->params);
@@ -1727,7 +1727,7 @@ spu_elf_size_stubs (struct bfd_link_info *info)
       flags = SEC_ALLOC;
       htab->ovtab = bfd_make_section_anyway_with_flags (ibfd, ".ovtab", flags);
       if (htab->ovtab == NULL
-         || !bfd_set_section_alignment (ibfd, htab->ovtab, 4))
+         || !bfd_set_section_alignment (htab->ovtab, 4))
        return 0;
 
       htab->ovtab->size = (16 + 16 + (16 << htab->fromelem_size_log2))
@@ -1736,7 +1736,7 @@ spu_elf_size_stubs (struct bfd_link_info *info)
       flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
       htab->init = bfd_make_section_anyway_with_flags (ibfd, ".ovini", flags);
       if (htab->init == NULL
-         || !bfd_set_section_alignment (ibfd, htab->init, 4))
+         || !bfd_set_section_alignment (htab->init, 4))
        return 0;
 
       htab->init->size = 16;
@@ -1761,7 +1761,7 @@ spu_elf_size_stubs (struct bfd_link_info *info)
       flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
       htab->ovtab = bfd_make_section_anyway_with_flags (ibfd, ".ovtab", flags);
       if (htab->ovtab == NULL
-         || !bfd_set_section_alignment (ibfd, htab->ovtab, 4))
+         || !bfd_set_section_alignment (htab->ovtab, 4))
        return 0;
 
       htab->ovtab->size = htab->num_overlays * 16 + 16 + htab->num_buf * 4;
@@ -1769,7 +1769,7 @@ spu_elf_size_stubs (struct bfd_link_info *info)
 
   htab->toe = bfd_make_section_anyway_with_flags (ibfd, ".toe", SEC_ALLOC);
   if (htab->toe == NULL
-      || !bfd_set_section_alignment (ibfd, htab->toe, 4))
+      || !bfd_set_section_alignment (htab->toe, 4))
     return 0;
   htab->toe->size = 16;
 
@@ -5049,7 +5049,7 @@ spu_elf_relocate_section (bfd *output_bfd,
            (_("%pB(%s+%#" PRIx64 "): "
               "unresolvable %s relocation against symbol `%s'"),
             input_bfd,
-            bfd_get_section_name (input_bfd, input_section),
+            bfd_section_name (input_section),
             (uint64_t) rel->r_offset,
             howto->name,
             sym_name);
@@ -5436,7 +5436,7 @@ spu_elf_modify_program_headers (bfd *abfd, struct bfd_link_info *info)
 }
 
 bfd_boolean
-spu_elf_size_sections (bfd * output_bfd, struct bfd_link_info *info)
+spu_elf_size_sections (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
 {
   struct spu_link_hash_table *htab = spu_hash_table (info);
   if (htab->params->emit_fixups)
@@ -5493,7 +5493,7 @@ spu_elf_size_sections (bfd * output_bfd, struct bfd_link_info *info)
 
       /* We always have a NULL fixup as a sentinel */
       size = (fixup_count + 1) * FIXUP_RECORD_SIZE;
-      if (!bfd_set_section_size (output_bfd, sfixup, size))
+      if (!bfd_set_section_size (sfixup, size))
        return FALSE;
       sfixup->contents = (bfd_byte *) bfd_zalloc (info->input_bfds, size);
       if (sfixup->contents == NULL)
index 87ec8475a8a1c1704d55394eae47ca08cf2e4ad0..258349cfb7537cc3f4009e206550e833e7d5331d 100644 (file)
@@ -1684,8 +1684,8 @@ elf32_tic6x_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->dsbt = bfd_make_section_anyway_with_flags (dynobj, ".dsbt",
                                                   flags);
   if (htab->dsbt == NULL
-      || ! bfd_set_section_alignment (dynobj, htab->dsbt, 2)
-      || ! bfd_set_section_alignment (dynobj, htab->elf.splt, 5))
+      || !bfd_set_section_alignment (htab->dsbt, 2)
+      || !bfd_set_section_alignment (htab->elf.splt, 5))
     return FALSE;
 
   return TRUE;
@@ -1992,7 +1992,7 @@ elf32_tic6x_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
 {
   const char * name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (is_tic6x_elf_unwind_section_name (name))
     {
@@ -2683,7 +2683,7 @@ elf32_tic6x_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);
            }
 
          switch (r)
@@ -3016,7 +3016,7 @@ elf32_tic6x_add_symbol_hook (bfd *abfd,
       *secp = bfd_make_section_old_way (abfd, ".scommon");
       (*secp)->flags |= SEC_IS_COMMON;
       *valp = sym->st_size;
-      (void) bfd_set_section_alignment (abfd, *secp, bfd_log2 (sym->st_value));
+      bfd_set_section_alignment (*secp, bfd_log2 (sym->st_value));
       break;
     }
 
@@ -3072,7 +3072,7 @@ elf32_tic6x_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_TIC6X_SCOMMON;
       return TRUE;
@@ -3385,7 +3385,7 @@ elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
          if (s == htab->elf.splt && s->size > 0)
            s->size = (s->size + 31) & ~(bfd_vma)31;
        }
-      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->elf.srelplt)
@@ -3992,10 +3992,10 @@ elf32_tic6x_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.  */
index 832561d2606040e1cdafd21d4d4a4427da2c5f67..249b3aaf5ba557ac1efe676b8fa1e0c251c958b6 100644 (file)
@@ -1229,13 +1229,13 @@ tilepro_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
                                   (bed->dynamic_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->srelgot = s;
 
   s = s_got = bfd_make_section_with_flags (abfd, ".got", 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->sgot = s;
 
@@ -1246,8 +1246,7 @@ tilepro_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
     {
       s = bfd_make_section_with_flags (abfd, ".got.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->sgotplt = s;
 
@@ -2754,7 +2753,7 @@ tilepro_elf_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_type)
index 74e15463212b9d4c1842ab7cd6cda70bc34e3af6..21df3c8b9ac21b46a41692b6f685fe45da3334cd 100644 (file)
@@ -177,7 +177,7 @@ v850_elf_check_relocs (bfd *abfd,
 
          if (h && h->root.type == bfd_link_hash_common
              && h->root.u.c.p
-             && !strcmp (bfd_get_section_name (abfd, h->root.u.c.p->section), "COMMON"))
+             && !strcmp (bfd_section_name (h->root.u.c.p->section), "COMMON"))
            {
              asection * section;
 
@@ -2269,7 +2269,7 @@ v850_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 ((int) r)
@@ -2372,11 +2372,11 @@ v850_elf_make_note_section (bfd * abfd)
   if (s == NULL)
     return NULL;
 
-  if (!bfd_set_section_alignment (abfd, s, 2))
+  if (!bfd_set_section_alignment (s, 2))
     return NULL;
 
   /* Allocate space for all known notes.  */
-  if (!bfd_set_section_size (abfd, s, NUM_V850_NOTES * SIZEOF_V850_NOTE))
+  if (!bfd_set_section_size (s, NUM_V850_NOTES * SIZEOF_V850_NOTE))
     return NULL;
 
   data = bfd_zalloc (abfd, NUM_V850_NOTES * SIZEOF_V850_NOTE);
@@ -2443,7 +2443,7 @@ v850_elf_copy_notes (bfd *ibfd, bfd *obfd)
   if ((inotes = bfd_get_section_by_name (ibfd, V850_NOTE_SECNAME)) == NULL)
     return;
 
-  if (bfd_section_size (ibfd, inotes) == bfd_section_size (obfd, onotes))
+  if (bfd_section_size (inotes) == bfd_section_size (onotes))
     {
       bfd_byte * icont;
       bfd_byte * ocont;
@@ -2457,7 +2457,7 @@ v850_elf_copy_notes (bfd *ibfd, bfd *obfd)
        return;
 
       /* Copy/overwrite notes from the input to the output.  */
-      memcpy (ocont, icont, bfd_section_size (obfd, onotes));
+      memcpy (ocont, icont, bfd_section_size (onotes));
     }
 }
 
@@ -2490,7 +2490,7 @@ v850_elf_merge_notes (bfd * ibfd, bfd *obfd)
       bfd_byte * icont;
       bfd_byte * ocont;
 
-      BFD_ASSERT (bfd_section_size (ibfd, inotes) == bfd_section_size (obfd, onotes));
+      BFD_ASSERT (bfd_section_size (inotes) == bfd_section_size (onotes));
 
       if ((icont = elf_section_data (inotes)->this_hdr.contents) == NULL)
        BFD_ASSERT (bfd_malloc_and_get_section (ibfd, inotes, & icont));
@@ -2672,7 +2672,7 @@ v850_elf_print_notes (bfd * abfd, FILE * file)
   if (notes == NULL || notes->contents == NULL)
     return;
 
-  BFD_ASSERT (bfd_section_size (abfd, notes) == NUM_V850_NOTES * SIZEOF_V850_NOTE);
+  BFD_ASSERT (bfd_section_size (notes) == NUM_V850_NOTES * SIZEOF_V850_NOTE);
 
   for (id = V850_NOTE_ALIGNMENT; id <= NUM_V850_NOTES; id++)
     print_v850_note (abfd, file, notes->contents, id);
@@ -2946,11 +2946,11 @@ v850_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_V850_SCOMMON;
-  else if (strcmp (bfd_get_section_name (abfd, sec), ".tcommon") == 0)
+  else if (strcmp (bfd_section_name (sec), ".tcommon") == 0)
     *retval = SHN_V850_TCOMMON;
-  else if (strcmp (bfd_get_section_name (abfd, sec), ".zcommon") == 0)
+  else if (strcmp (bfd_section_name (sec), ".zcommon") == 0)
     *retval = SHN_V850_ZCOMMON;
   else
     return FALSE;
@@ -3162,10 +3162,9 @@ v850_elf_section_from_shdr (bfd *abfd,
     case SHT_V850_SCOMMON:
     case SHT_V850_TCOMMON:
     case SHT_V850_ZCOMMON:
-      if (! bfd_set_section_flags (abfd, hdr->bfd_section,
-                                  (bfd_get_section_flags (abfd,
-                                                          hdr->bfd_section)
-                                   | SEC_IS_COMMON)))
+      if (!bfd_set_section_flags (hdr->bfd_section,
+                                 (bfd_section_flags (hdr->bfd_section)
+                                  | SEC_IS_COMMON)))
        return FALSE;
     }
 
@@ -3182,7 +3181,7 @@ v850_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
 {
   const char * name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (strcmp (name, ".scommon") == 0)
     hdr->sh_type = SHT_V850_SCOMMON;
index 2af7050707925ed49b4373cd15133afc62f82780..80162d87cb26d1b42e4b658c3cc3aee99c97740b 100644 (file)
@@ -1069,7 +1069,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
 
       /* 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)
        {
@@ -1094,8 +1094,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
                     section, then we probably need a DT_TEXTREL
                     entry.  .rela.plt is actually associated with
                     .got.plt, which is never 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
@@ -1633,7 +1632,7 @@ elf_vax_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);
                  }
                info->callbacks->reloc_overflow
                  (info, (h ? &h->root : NULL), name, howto->name,
index 76271ce7cd472af7b864d3efd6e6c2802267acfd..35e4b84ed1408bd53378cdd6f8b24139bea8d71c 100644 (file)
@@ -599,7 +599,7 @@ visium_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
        {
index 05a932668529d3dfd8d07f6860b9627d2f09865b..ef106b3f928a441c2d8640d300cbd2899bba2a48 100644 (file)
@@ -471,7 +471,7 @@ xstormy16_elf_check_relocs (bfd *abfd,
                                                         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;
            }
 
@@ -834,7 +834,7 @@ xstormy16_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);
        }
 
       switch (ELF32_R_TYPE (rel->r_info))
index 8a7bf7e96f8c7559ee4319d1e515095a8c068178..306b18b4f265fad72ab81afdf1230e7c213b7f33 100644 (file)
@@ -1320,21 +1320,21 @@ elf_xtensa_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
 
   /* Mark the ".got.plt" section READONLY.  */
   if (htab->elf.sgotplt == NULL
-      || ! bfd_set_section_flags (dynobj, htab->elf.sgotplt, flags))
+      || !bfd_set_section_flags (htab->elf.sgotplt, flags))
     return FALSE;
 
   /* Create ".got.loc" (literal tables for use by dynamic linker).  */
   htab->sgotloc = bfd_make_section_anyway_with_flags (dynobj, ".got.loc",
                                                      flags);
   if (htab->sgotloc == NULL
-      || ! bfd_set_section_alignment (dynobj, htab->sgotloc, 2))
+      || !bfd_set_section_alignment (htab->sgotloc, 2))
     return FALSE;
 
   /* Create ".xt.lit.plt" (literal table for ".got.plt*").  */
   htab->spltlittbl = bfd_make_section_anyway_with_flags (dynobj, ".xt.lit.plt",
                                                         noalloc_flags);
   if (htab->spltlittbl == NULL
-      || ! bfd_set_section_alignment (dynobj, htab->spltlittbl, 2))
+      || !bfd_set_section_alignment (htab->spltlittbl, 2))
     return FALSE;
 
   return TRUE;
@@ -1366,14 +1366,14 @@ add_extra_plt_sections (struct bfd_link_info *info, int count)
       sprintf (sname, ".plt.%u", chunk);
       s = bfd_make_section_anyway_with_flags (dynobj, sname, flags | SEC_CODE);
       if (s == NULL
-         || ! bfd_set_section_alignment (dynobj, s, 2))
+         || !bfd_set_section_alignment (s, 2))
        return FALSE;
 
       sname = (char *) bfd_malloc (14);
       sprintf (sname, ".got.plt.%u", chunk);
       s = bfd_make_section_anyway_with_flags (dynobj, sname, flags);
       if (s == NULL
-         || ! bfd_set_section_alignment (dynobj, s, 2))
+         || !bfd_set_section_alignment (s, 2))
        return FALSE;
     }
 
@@ -1626,7 +1626,7 @@ elf_xtensa_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 (CONST_STRNEQ (name, ".rela"))
        {
@@ -2687,7 +2687,7 @@ elf_xtensa_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
@@ -11244,7 +11244,7 @@ xtensa_make_property_section (asection *sec, const char *base_name)
   if (! prop_sec)
     {
       flagword flags = (SEC_RELOC | SEC_HAS_CONTENTS | SEC_READONLY);
-      flags |= (bfd_get_section_flags (sec->owner, sec)
+      flags |= (bfd_section_flags (sec)
                & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES));
 
       prop_sec = bfd_make_section_anyway_with_flags
index 490860123c917241104069418f7da2754085080f..84ec83b74af55b9b38b96532ec068b2d7684a5d5 100644 (file)
@@ -1168,9 +1168,8 @@ elf64_alpha_section_from_shdr (bfd *abfd,
 
   if (hdr->sh_type == SHT_ALPHA_DEBUG)
     {
-      if (! bfd_set_section_flags (abfd, newsect,
-                                  (bfd_get_section_flags (abfd, newsect)
-                                   | SEC_DEBUGGING)))
+      if (!bfd_set_section_flags (newsect,
+                                 bfd_section_flags (newsect) | SEC_DEBUGGING))
        return FALSE;
     }
 
@@ -1196,7 +1195,7 @@ elf64_alpha_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
 {
   register const char *name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (strcmp (name, ".mdebug") == 0)
     {
@@ -1270,7 +1269,7 @@ elf64_alpha_create_got_section (bfd *abfd,
           | SEC_LINKER_CREATED);
   s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
 
   alpha_elf_tdata (abfd)->got = s;
@@ -1302,7 +1301,7 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
           | (elf64_alpha_use_secureplt ? SEC_READONLY : 0));
   s = bfd_make_section_anyway_with_flags (abfd, ".plt", flags);
   elf_hash_table (info)->splt = s;
-  if (s == NULL || ! bfd_set_section_alignment (abfd, s, 4))
+  if (s == NULL || ! bfd_set_section_alignment (s, 4))
     return FALSE;
 
   /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
@@ -1317,7 +1316,7 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
           | SEC_LINKER_CREATED | SEC_READONLY);
   s = bfd_make_section_anyway_with_flags (abfd, ".rela.plt", flags);
   elf_hash_table (info)->srelplt = s;
-  if (s == NULL || ! bfd_set_section_alignment (abfd, s, 3))
+  if (s == NULL || ! bfd_set_section_alignment (s, 3))
     return FALSE;
 
   if (elf64_alpha_use_secureplt)
@@ -1325,7 +1324,7 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       flags = SEC_ALLOC | SEC_LINKER_CREATED;
       s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
       elf_hash_table (info)->sgotplt = s;
-      if (s == NULL || ! bfd_set_section_alignment (abfd, s, 3))
+      if (s == NULL || ! bfd_set_section_alignment (s, 3))
        return FALSE;
     }
 
@@ -1343,7 +1342,7 @@ elf64_alpha_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   s = bfd_make_section_anyway_with_flags (abfd, ".rela.got", flags);
   elf_hash_table (info)->srelgot = s;
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
 
   /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the
@@ -1616,7 +1615,7 @@ elf64_alpha_output_extsym (struct alpha_elf_link_hash_entry *h, void * data)
            h->esym.asym.sc = scUndefined;
          else
            {
-             name = bfd_section_name (output_section->owner, output_section);
+             name = bfd_section_name (output_section);
 
              if (strcmp (name, ".text") == 0)
                h->esym.asym.sc = scText;
@@ -2860,7 +2859,7 @@ elf64_alpha_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 (CONST_STRNEQ (name, ".rela"))
        {
@@ -4508,7 +4507,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                    if (name == NULL)
                      name = _("<unknown>");
                    else if (name[0] == 0)
-                     name = bfd_section_name (input_bfd, sec);
+                     name = bfd_section_name (sec);
                  }
                _bfd_error_handler
                  /* xgettext:c-format */
@@ -4779,7 +4778,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                if (name == NULL)
                  return FALSE;
                if (*name == '\0')
-                 name = bfd_section_name (input_bfd, sec);
+                 name = bfd_section_name (sec);
              }
            (*info->callbacks->reloc_overflow)
              (info, (h ? &h->root.root : NULL), name, howto->name,
index 3e11f089ecb7f0adda32a5eb1ab4a6f3d355e164..67c45a1fa449ad3f546d20fe41a38d6b383f3109 100644 (file)
@@ -407,7 +407,7 @@ bpf_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
        {
index 77811580c679b535aea388ea8f10fb9be78937c7..25e91d8a233c00ecde980ba8c2bbbf0ed7842004 100644 (file)
@@ -422,7 +422,7 @@ get_reloc_section (bfd *abfd,
                                                  | SEC_LINKER_CREATED
                                                  | SEC_READONLY));
       if (srel == NULL
-         || !bfd_set_section_alignment (dynobj, srel, 3))
+         || !bfd_set_section_alignment (srel, 3))
        return FALSE;
     }
 
@@ -1159,7 +1159,7 @@ get_opd (bfd *abfd,
                                                 | SEC_IN_MEMORY
                                                 | SEC_LINKER_CREATED));
       if (!opd
-         || !bfd_set_section_alignment (abfd, opd, 3))
+         || !bfd_set_section_alignment (opd, 3))
        {
          BFD_ASSERT (0);
          return FALSE;
@@ -1195,7 +1195,7 @@ get_plt (bfd *abfd,
                                                 | SEC_IN_MEMORY
                                                 | SEC_LINKER_CREATED));
       if (!plt
-         || !bfd_set_section_alignment (abfd, plt, 3))
+         || !bfd_set_section_alignment (plt, 3))
        {
          BFD_ASSERT (0);
          return FALSE;
@@ -1231,7 +1231,7 @@ get_dlt (bfd *abfd,
                                                 | SEC_IN_MEMORY
                                                 | SEC_LINKER_CREATED));
       if (!dlt
-         || !bfd_set_section_alignment (abfd, dlt, 3))
+         || !bfd_set_section_alignment (dlt, 3))
        {
          BFD_ASSERT (0);
          return FALSE;
@@ -1267,7 +1267,7 @@ get_stub (bfd *abfd,
                                                  | SEC_READONLY
                                                  | SEC_LINKER_CREATED));
       if (!stub
-         || !bfd_set_section_alignment (abfd, stub, 3))
+         || !bfd_set_section_alignment (stub, 3))
        {
          BFD_ASSERT (0);
          return FALSE;
@@ -1347,7 +1347,7 @@ elf64_hppa_create_dynamic_sections (bfd *abfd,
                                           | SEC_READONLY
                                           | SEC_LINKER_CREATED));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
   hppa_info->dlt_rel_sec = s;
 
@@ -1358,7 +1358,7 @@ elf64_hppa_create_dynamic_sections (bfd *abfd,
                                           | SEC_READONLY
                                           | SEC_LINKER_CREATED));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
   hppa_info->plt_rel_sec = s;
 
@@ -1369,7 +1369,7 @@ elf64_hppa_create_dynamic_sections (bfd *abfd,
                                           | SEC_READONLY
                                           | SEC_LINKER_CREATED));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
   hppa_info->other_rel_sec = s;
 
@@ -1380,7 +1380,7 @@ elf64_hppa_create_dynamic_sections (bfd *abfd,
                                           | SEC_READONLY
                                           | SEC_LINKER_CREATED));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
   hppa_info->opd_rel_sec = s;
 
@@ -1750,7 +1750,7 @@ elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
 
       /* 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, sec);
+      name = bfd_section_name (sec);
 
       if (strcmp (name, ".plt") == 0)
        {
@@ -1783,8 +1783,7 @@ elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
                     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,
-                                                 sec->output_section);
+                 outname = bfd_section_name (sec->output_section);
                  target = bfd_get_section_by_name (output_bfd, outname + 4);
                  if (target != NULL
                      && (target->flags & SEC_READONLY) != 0
@@ -3938,7 +3937,7 @@ elf64_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);
                  }
 
                (*info->callbacks->reloc_overflow)
index 0ae9f353f48b0be1dc64fc0688143c9cc635e311..aa2aa119f5e6e7b6c8cde7c46b8ad89d49dd5c9f 100644 (file)
@@ -840,7 +840,7 @@ elf64_ia64_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr,
 {
   const char *name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (is_unwind_section_name (abfd, name))
     {
@@ -1286,12 +1286,12 @@ elf64_ia64_create_dynamic_sections (bfd *abfd,
   s = bfd_make_section_anyway_with_flags (abfd, ".dynamic",
                                          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;
 
   s = bfd_make_section_anyway_with_flags (abfd, ".plt", flags | SEC_READONLY);
   if (s == NULL
-      || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+      || !bfd_set_section_alignment (s, bed->plt_alignment))
     return FALSE;
   ia64_info->root.splt = s;
 
@@ -1307,7 +1307,7 @@ elf64_ia64_create_dynamic_sections (bfd *abfd,
                                           | SEC_IN_MEMORY
                                           | SEC_LINKER_CREATED));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 0))
+      || !bfd_set_section_alignment (s, 0))
     return FALSE;
 
   /* Create a fixup section.  */
@@ -1317,7 +1317,7 @@ elf64_ia64_create_dynamic_sections (bfd *abfd,
                                           | SEC_IN_MEMORY
                                           | SEC_LINKER_CREATED));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
   ia64_info->fixups_sec = s;
 
@@ -1328,7 +1328,7 @@ elf64_ia64_create_dynamic_sections (bfd *abfd,
                                           | SEC_IN_MEMORY
                                           | SEC_LINKER_CREATED));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
   s->size = sizeof (struct elf64_vms_transfer);
   ia64_info->transfer_sec = s;
@@ -1340,7 +1340,7 @@ elf64_ia64_create_dynamic_sections (bfd *abfd,
                                           | SEC_IN_MEMORY
                                           | SEC_READONLY));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, 3))
+      || !bfd_set_section_alignment (s, 3))
     return FALSE;
   ia64_info->note_sec = s;
 
@@ -1738,7 +1738,7 @@ get_got (bfd *abfd, struct elf64_ia64_link_hash_table *ia64_info)
       got = bfd_make_section_anyway_with_flags (dynobj, ".got",
                                                flags | SEC_SMALL_DATA);
       if (got == NULL
-         || !bfd_set_section_alignment (dynobj, got, 3))
+         || !bfd_set_section_alignment (got, 3))
        return NULL;
       ia64_info->root.sgot = got;
     }
@@ -1774,7 +1774,7 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
                                                     : SEC_READONLY)
                                                  | SEC_LINKER_CREATED));
       if (!fptr
-         || !bfd_set_section_alignment (dynobj, fptr, 4))
+         || !bfd_set_section_alignment (fptr, 4))
        {
          BFD_ASSERT (0);
          return NULL;
@@ -1792,7 +1792,7 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
                                                          | SEC_LINKER_CREATED
                                                          | SEC_READONLY));
          if (fptr_rel == NULL
-             || !bfd_set_section_alignment (dynobj, fptr_rel, 3))
+             || !bfd_set_section_alignment (fptr_rel, 3))
            {
              BFD_ASSERT (0);
              return NULL;
@@ -1827,7 +1827,7 @@ get_pltoff (bfd *abfd, struct elf64_ia64_link_hash_table *ia64_info)
                                                    | SEC_SMALL_DATA
                                                    | SEC_LINKER_CREATED));
       if (!pltoff
-         || !bfd_set_section_alignment (dynobj, pltoff, 4))
+         || !bfd_set_section_alignment (pltoff, 4))
        {
          BFD_ASSERT (0);
          return NULL;
@@ -1855,11 +1855,9 @@ get_reloc_section (bfd *abfd,
     return NULL;
 
   BFD_ASSERT ((CONST_STRNEQ (srel_name, ".rela")
-              && strcmp (bfd_get_section_name (abfd, sec),
-                         srel_name+5) == 0)
+              && strcmp (bfd_section_name (sec), srel_name+5) == 0)
              || (CONST_STRNEQ (srel_name, ".rel")
-                 && strcmp (bfd_get_section_name (abfd, sec),
-                            srel_name+4) == 0));
+                 && strcmp (bfd_section_name (sec), srel_name+4) == 0));
 
   dynobj = ia64_info->root.dynobj;
   if (!dynobj)
@@ -1875,7 +1873,7 @@ get_reloc_section (bfd *abfd,
                                                  | SEC_LINKER_CREATED
                                                  | SEC_READONLY));
       if (srel == NULL
-         || !bfd_set_section_alignment (dynobj, srel, 3))
+         || !bfd_set_section_alignment (srel, 3))
        return NULL;
     }
 
@@ -2750,7 +2748,7 @@ elf64_ia64_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, sec);
+         name = bfd_section_name (sec);
 
          if (strcmp (name, ".got.plt") == 0)
            strip = FALSE;
@@ -4501,8 +4499,8 @@ elf64_vms_section_from_shdr (bfd *abfd,
     {
       asection *newsect = hdr->bfd_section;
 
-      if (! bfd_set_section_flags
-         (abfd, newsect, bfd_get_section_flags (abfd, newsect) | secflags))
+      if (!bfd_set_section_flags (newsect,
+                                 bfd_section_flags (newsect) | secflags))
        return FALSE;
     }
 
@@ -4629,7 +4627,7 @@ elf64_vms_section_processing (bfd *abfd ATTRIBUTE_UNUSED,
 {
   if (hdr->bfd_section != NULL)
     {
-      const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+      const char *name = bfd_section_name (hdr->bfd_section);
 
       if (strcmp (name, ".text") == 0)
        hdr->sh_flags |= SHF_IA_64_VMS_SHARED;
@@ -4670,7 +4668,7 @@ elf64_vms_final_write_processing (bfd *abfd)
     {
       hdr = &elf_section_data (s)->this_hdr;
 
-      if (strcmp (bfd_get_section_name (abfd, hdr->bfd_section),
+      if (strcmp (bfd_section_name (hdr->bfd_section),
                  ".IA_64.unwind_info") == 0)
        unwind_info_sect_idx = elf_section_data (s)->this_idx;
 
index 18ed456c2bf27d48e9458f8aaf4499054a3f672d..69d57a2ce96120ddbb4c5be9f197aa5ba7b1f56d 100644 (file)
@@ -1414,7 +1414,7 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                                                  symtab_hdr->sh_link,
                                                  sym->st_name);
          if (name == NULL)
-           name = bfd_section_name (input_bfd, sec);
+           name = bfd_section_name (sec);
        }
       else
        {
@@ -1606,9 +1606,9 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
        return bfd_reloc_undefined;
 
       /* Check that we're not relocating against a register symbol.  */
-      if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+      if (strcmp (bfd_section_name (symsec),
                  MMIX_REG_CONTENTS_SECTION_NAME) == 0
-         || strcmp (bfd_get_section_name (symsec->owner, symsec),
+         || strcmp (bfd_section_name (symsec),
                     MMIX_REG_SECTION_NAME) == 0)
        {
          /* Note: This is separated out into two messages in order
@@ -1641,7 +1641,7 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
       if (symsec == NULL)
        return bfd_reloc_undefined;
 
-      if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+      if (strcmp (bfd_section_name (symsec),
                  MMIX_REG_CONTENTS_SECTION_NAME) == 0)
        {
          if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8)
@@ -1652,7 +1652,7 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
            }
          srel /= 8;
        }
-      else if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+      else if (strcmp (bfd_section_name (symsec),
                       MMIX_REG_SECTION_NAME) == 0)
        {
          if (srel < 0 || srel > 255)
@@ -1704,9 +1704,9 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
           accidentally handling it.  */
        if (!bfd_is_abs_section (symsec)
            && !bfd_is_und_section (symsec)
-           && strcmp (bfd_get_section_name (symsec->owner, symsec),
+           && strcmp (bfd_section_name (symsec),
                       MMIX_REG_CONTENTS_SECTION_NAME) != 0
-           && strcmp (bfd_get_section_name (symsec->owner, symsec),
+           && strcmp (bfd_section_name (symsec),
                       MMIX_REG_SECTION_NAME) != 0)
        {
          _bfd_error_handler
@@ -1722,10 +1722,8 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section,
        first_global = 255;
       else
        {
-         first_global
-           = bfd_get_section_vma (input_section->output_section->owner,
-                                  regsec) / 8;
-         if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+         first_global = bfd_section_vma (regsec) / 8;
+         if (strcmp (bfd_section_name (symsec),
                      MMIX_REG_CONTENTS_SECTION_NAME) == 0)
            {
              if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8)
@@ -1876,9 +1874,7 @@ mmix_elf_check_common_relocs  (bfd *abfd,
                 those flags, as that is what currently happens for usual
                 GREG allocations, and that works.  */
              if (allocated_gregs_section == NULL
-                 || !bfd_set_section_alignment (bpo_greg_owner,
-                                                allocated_gregs_section,
-                                                3))
+                 || !bfd_set_section_alignment (allocated_gregs_section, 3))
                return FALSE;
 
              gregdata = (struct bpo_greg_section_info *)
@@ -2123,7 +2119,7 @@ mmix_elf_section_from_bfd_section (bfd *       abfd ATTRIBUTE_UNUSED,
                                   asection *  sec,
                                   int *       retval)
 {
-  if (strcmp (bfd_get_section_name (abfd, sec), MMIX_REG_SECTION_NAME) == 0)
+  if (strcmp (bfd_section_name (sec), MMIX_REG_SECTION_NAME) == 0)
     *retval = SHN_REGISTER;
   else
     return FALSE;
@@ -2222,7 +2218,7 @@ mmix_elf_final_link (bfd *abfd, struct bfd_link_info *info)
   if (reg_section != NULL)
     {
       /* FIXME: Pass error state gracefully.  */
-      if (bfd_get_section_flags (abfd, reg_section) & SEC_HAS_CONTENTS)
+      if (bfd_section_flags (reg_section) & SEC_HAS_CONTENTS)
        _bfd_abort (__FILE__, __LINE__, _("register section has contents\n"));
 
       /* Really remove the section, if it hasn't already been done.  */
@@ -2330,7 +2326,7 @@ _bfd_mmix_before_linker_allocation (bfd *abfd ATTRIBUTE_UNUSED,
   /* Set the zeroth-order estimate for the GREGs size.  */
   gregs_size = n_gregs * 8;
 
-  if (!bfd_set_section_size (bpo_greg_owner, bpo_gregs_section, gregs_size))
+  if (!bfd_set_section_size (bpo_gregs_section, gregs_size))
     return FALSE;
 
   /* Allocate and set up the GREG arrays.  They're filled in at relaxation
index 345710ee594d88f00447db3f3c729bc8eba28d6a..14119dd259a984b3272099eec55137baf09018b8 100644 (file)
@@ -3487,7 +3487,7 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
       htab->sfpr = bfd_make_section_anyway_with_flags (dynobj, ".sfpr",
                                                       flags);
       if (htab->sfpr == NULL
-         || !bfd_set_section_alignment (dynobj, htab->sfpr, 2))
+         || !bfd_set_section_alignment (htab->sfpr, 2))
        return FALSE;
     }
 
@@ -3498,7 +3498,7 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->glink = bfd_make_section_anyway_with_flags (dynobj, ".glink",
                                                    flags);
   if (htab->glink == NULL
-      || !bfd_set_section_alignment (dynobj, htab->glink, 3))
+      || !bfd_set_section_alignment (htab->glink, 3))
     return FALSE;
 
   /* The part of .glink used by global entry stubs, separate so that
@@ -3506,7 +3506,7 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->global_entry = bfd_make_section_anyway_with_flags (dynobj, ".glink",
                                                           flags);
   if (htab->global_entry == NULL
-      || !bfd_set_section_alignment (dynobj, htab->global_entry, 2))
+      || !bfd_set_section_alignment (htab->global_entry, 2))
     return FALSE;
 
   if (!info->no_ld_generated_unwind_info)
@@ -3517,14 +3517,14 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
                                                                 ".eh_frame",
                                                                 flags);
       if (htab->glink_eh_frame == NULL
-         || !bfd_set_section_alignment (dynobj, htab->glink_eh_frame, 2))
+         || !bfd_set_section_alignment (htab->glink_eh_frame, 2))
        return FALSE;
     }
 
   flags = SEC_ALLOC | SEC_LINKER_CREATED;
   htab->elf.iplt = bfd_make_section_anyway_with_flags (dynobj, ".iplt", flags);
   if (htab->elf.iplt == NULL
-      || !bfd_set_section_alignment (dynobj, htab->elf.iplt, 3))
+      || !bfd_set_section_alignment (htab->elf.iplt, 3))
     return FALSE;
 
   flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY
@@ -3532,7 +3532,7 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->elf.irelplt
     = bfd_make_section_anyway_with_flags (dynobj, ".rela.iplt", flags);
   if (htab->elf.irelplt == NULL
-      || !bfd_set_section_alignment (dynobj, htab->elf.irelplt, 3))
+      || !bfd_set_section_alignment (htab->elf.irelplt, 3))
     return FALSE;
 
   /* Create branch lookup table for plt_branch stubs.  */
@@ -3541,7 +3541,7 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->brlt = bfd_make_section_anyway_with_flags (dynobj, ".branch_lt",
                                                   flags);
   if (htab->brlt == NULL
-      || !bfd_set_section_alignment (dynobj, htab->brlt, 3))
+      || !bfd_set_section_alignment (htab->brlt, 3))
     return FALSE;
 
   /* Local plt entries, put in .branch_lt but a separate section for
@@ -3549,7 +3549,7 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->pltlocal = bfd_make_section_anyway_with_flags (dynobj, ".branch_lt",
                                                       flags);
   if (htab->pltlocal == NULL
-      || !bfd_set_section_alignment (dynobj, htab->pltlocal, 3))
+      || !bfd_set_section_alignment (htab->pltlocal, 3))
     return FALSE;
 
   if (!bfd_link_pic (info))
@@ -3560,13 +3560,13 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->relbrlt
     = bfd_make_section_anyway_with_flags (dynobj, ".rela.branch_lt", flags);
   if (htab->relbrlt == NULL
-      || !bfd_set_section_alignment (dynobj, htab->relbrlt, 3))
+      || !bfd_set_section_alignment (htab->relbrlt, 3))
     return FALSE;
 
   htab->relpltlocal
     = bfd_make_section_anyway_with_flags (dynobj, ".rela.branch_lt", flags);
   if (htab->relpltlocal == NULL
-      || !bfd_set_section_alignment (dynobj, htab->relpltlocal, 3))
+      || !bfd_set_section_alignment (htab->relpltlocal, 3))
     return FALSE;
 
   return TRUE;
@@ -3762,13 +3762,13 @@ create_got_section (bfd *abfd, struct bfd_link_info *info)
 
   got = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
   if (!got
-      || !bfd_set_section_alignment (abfd, got, 3))
+      || !bfd_set_section_alignment (got, 3))
     return FALSE;
 
   relgot = bfd_make_section_anyway_with_flags (abfd, ".rela.got",
                                               flags | SEC_READONLY);
   if (!relgot
-      || !bfd_set_section_alignment (abfd, relgot, 3))
+      || !bfd_set_section_alignment (relgot, 3))
     return FALSE;
 
   ppc64_elf_tdata (abfd)->got = got;
index 6bc6dfd50eb5124a768a99f008d79e1b72aa7105..4ffcde92e212371e6ad8c4d21990276ae6a21c6d 100644 (file)
@@ -1957,7 +1957,7 @@ elf_s390_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->elf.srelplt)
            relocs = TRUE;
@@ -3203,7 +3203,7 @@ elf_s390_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)
index 50b051aa6bf01bd37c26fb28770c30c15c365584..8bf9623bd9fca6e240db79135353c19a2391fbb8 100644 (file)
@@ -748,7 +748,7 @@ elf64_sparc_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
 {
   const char *name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (strcmp (name, ".stab") == 0)
     {
index e5c8003a68e1dc71e84ec10fb434175e26df38ce..16e66f95d2c7b3cd5b79d670ad09cb9e8f59a040 100644 (file)
@@ -3989,7 +3989,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)
index 8f18be07db72bb93625ddf63efff2cc64fbedb22..2169e2b40cb05f59be350f8eeb8a983d9c4df40e 100644 (file)
@@ -162,13 +162,13 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
                                          (bed->dynamic_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->srelgot = s;
 
   s = bfd_make_section_anyway_with_flags (abfd, ".got", 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->sgot = s;
 
@@ -176,8 +176,7 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
     {
       s = bfd_make_section_anyway_with_flags (abfd, ".got.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->sgotplt = s;
     }
@@ -286,25 +285,25 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version_d",
                                          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;
 
   s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version",
                                          flags | SEC_READONLY);
   if (s == NULL
-      || ! bfd_set_section_alignment (abfd, s, 1))
+      || !bfd_set_section_alignment (s, 1))
     return FALSE;
 
   s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version_r",
                                          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;
 
   s = bfd_make_section_anyway_with_flags (abfd, ".dynsym",
                                          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;
   elf_hash_table (info)->dynsym = s;
 
@@ -315,7 +314,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
 
   s = bfd_make_section_anyway_with_flags (abfd, ".dynamic", 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;
 
   /* The special symbol _DYNAMIC is always set to the start of the
@@ -334,7 +333,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section_anyway_with_flags (abfd, ".hash",
                                              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;
       elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
     }
@@ -344,7 +343,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section_anyway_with_flags (abfd, ".gnu.hash",
                                              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;
       /* For 64-bit ELF, .gnu.hash is a non-uniform entity size section:
         4 32-bit words followed by variable count of 64-bit words, then
@@ -395,7 +394,7 @@ _bfd_elf_create_dynamic_sections (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;
   htab->splt = s;
 
@@ -415,7 +414,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
                                           ? ".rela.plt" : ".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;
   htab->srelplt = s;
 
@@ -466,7 +465,7 @@ _bfd_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, bed->s->log_file_align))
+             || !bfd_set_section_alignment (s, bed->s->log_file_align))
            return FALSE;
          htab->srelbss = s;
 
@@ -477,8 +476,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
                           ? ".rela.data.rel.ro" : ".rel.data.rel.ro"),
                    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->sreldynrelro = s;
            }
@@ -3099,7 +3097,7 @@ _bfd_elf_adjust_dynamic_copy (struct bfd_link_info *info,
      know the symbol alignment requirement, we start with the
      maximum alignment and check low bits of the symbol address
      for the minimum alignment.  */
-  power_of_two = bfd_get_section_alignment (sec->owner, sec);
+  power_of_two = bfd_section_alignment (sec);
   mask = ((bfd_vma) 1 << power_of_two) - 1;
   while ((h->root.u.def.value & mask) != 0)
     {
@@ -3107,12 +3105,10 @@ _bfd_elf_adjust_dynamic_copy (struct bfd_link_info *info,
        --power_of_two;
     }
 
-  if (power_of_two > bfd_get_section_alignment (dynbss->owner,
-                                               dynbss))
+  if (power_of_two > bfd_section_alignment (dynbss))
     {
       /* Adjust the section alignment if needed.  */
-      if (! bfd_set_section_alignment (dynbss->owner, dynbss,
-                                      power_of_two))
+      if (!bfd_set_section_alignment (dynbss, power_of_two))
        return FALSE;
     }
 
@@ -3949,7 +3945,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
     {
       const char *name;
 
-      name = bfd_get_section_name (abfd, s);
+      name = bfd_section_name (s);
       if (CONST_STRNEQ (name, ".gnu.warning."))
        {
          char *msg;
@@ -11393,8 +11389,7 @@ elf_reloc_link_order (bfd *output_bfd,
 
        case bfd_reloc_overflow:
          if (link_order->type == bfd_section_reloc_link_order)
-           sym_name = bfd_section_name (output_bfd,
-                                        link_order->u.reloc.p->u.section);
+           sym_name = bfd_section_name (link_order->u.reloc.p->u.section);
          else
            sym_name = link_order->u.reloc.p->u.name;
          (*info->callbacks->reloc_overflow) (info, NULL, sym_name,
@@ -11837,7 +11832,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
            }
 
          attr_size = bfd_elf_obj_attr_size (abfd);
-         bfd_set_section_size (abfd, o, attr_size);
+         bfd_set_section_size (o, attr_size);
          /* Skip this section later on.  */
          o->map_head.link_order = NULL;
          if (attr_size)
@@ -13588,7 +13583,7 @@ bfd_elf_parse_eh_frame_entries (bfd *abfd ATTRIBUTE_UNUSED,
 
       for (sec = ibfd->sections; sec; sec = sec->next)
        {
-         if (CONST_STRNEQ (bfd_section_name (ibfd, sec), ".eh_frame_entry")
+         if (CONST_STRNEQ (bfd_section_name (sec), ".eh_frame_entry")
              && init_reloc_cookie_rels (&cookie, info, ibfd, sec))
            {
              _bfd_elf_parse_eh_frame_entry (info, sec, &cookie);
@@ -14444,7 +14439,7 @@ get_dynamic_reloc_section_name (bfd *       abfd,
                                bfd_boolean is_rela)
 {
   char *name;
-  const char *old_name = bfd_get_section_name (NULL, sec);
+  const char *old_name = bfd_section_name (sec);
   const char *prefix = is_rela ? ".rela" : ".rel";
 
   if (old_name == NULL)
@@ -14527,7 +14522,7 @@ _bfd_elf_make_dynamic_reloc_section (asection *sec,
                 section named "auto" we'll get ".relauto" which is
                 seen to be a .rela section.  */
              elf_section_type (reloc_sec) = is_rela ? SHT_RELA : SHT_REL;
-             if (! bfd_set_section_alignment (dynobj, reloc_sec, alignment))
+             if (!bfd_set_section_alignment (reloc_sec, alignment))
                reloc_sec = NULL;
            }
        }
index 7132b6bc7330c0d5d0cdeac1bd11c0817cdac245..6f3bd0d5650818e5429fc64775593a160ccee844 100644 (file)
@@ -6790,7 +6790,7 @@ elfNN_aarch64_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 != 0
@@ -7273,7 +7273,7 @@ elfNN_aarch64_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;
@@ -7519,13 +7519,13 @@ aarch64_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
                                          (bed->dynamic_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->srelgot = s;
 
   s = bfd_make_section_anyway_with_flags (abfd, ".got", 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->sgot = s;
   htab->sgot->size += GOT_ENTRY_SIZE;
@@ -7547,8 +7547,7 @@ aarch64_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
     {
       s = bfd_make_section_anyway_with_flags (abfd, ".got.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->sgotplt = s;
     }
@@ -9150,7 +9149,7 @@ elfNN_aarch64_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;
index 65471dd4a49bd046a83b9c6029052a1f257b2066..da10178d4feecdbbd87f437110222f9577f01811 100644 (file)
@@ -956,7 +956,7 @@ elfNN_ia64_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr,
 {
   const char *name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (is_unwind_section_name (abfd, name))
     {
@@ -1561,11 +1561,10 @@ elfNN_ia64_create_dynamic_sections (bfd *abfd,
     return FALSE;
 
   {
-    flagword flags = bfd_get_section_flags (abfd, ia64_info->root.sgot);
-    bfd_set_section_flags (abfd, ia64_info->root.sgot,
-                          SEC_SMALL_DATA | flags);
+    flagword flags = bfd_section_flags (ia64_info->root.sgot);
+    bfd_set_section_flags (ia64_info->root.sgot, SEC_SMALL_DATA | flags);
     /* The .got section is always aligned at 8 bytes.  */
-    if (! bfd_set_section_alignment (abfd, ia64_info->root.sgot, 3))
+    if (!bfd_set_section_alignment (ia64_info->root.sgot, 3))
       return FALSE;
   }
 
@@ -1579,7 +1578,7 @@ elfNN_ia64_create_dynamic_sections (bfd *abfd,
                                           | SEC_LINKER_CREATED
                                           | SEC_READONLY));
   if (s == NULL
-      || !bfd_set_section_alignment (abfd, s, LOG_SECTION_ALIGN))
+      || !bfd_set_section_alignment (s, LOG_SECTION_ALIGN))
     return FALSE;
   ia64_info->rel_pltoff_sec = s;
 
@@ -1977,11 +1976,11 @@ get_got (bfd *abfd, struct bfd_link_info *info,
       got = ia64_info->root.sgot;
 
       /* The .got section is always aligned at 8 bytes.  */
-      if (!bfd_set_section_alignment (abfd, got, 3))
+      if (!bfd_set_section_alignment (got, 3))
        return NULL;
 
-      flags = bfd_get_section_flags (abfd, got);
-      if (! bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags))
+      flags = bfd_section_flags (got);
+      if (!bfd_set_section_flags (got, SEC_SMALL_DATA | flags))
        return NULL;
     }
 
@@ -2016,7 +2015,7 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
                                                     ? 0 : SEC_READONLY)
                                                  | SEC_LINKER_CREATED));
       if (!fptr
-         || !bfd_set_section_alignment (abfd, fptr, 4))
+         || !bfd_set_section_alignment (fptr, 4))
        {
          BFD_ASSERT (0);
          return NULL;
@@ -2034,8 +2033,7 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
                                                          | SEC_LINKER_CREATED
                                                          | SEC_READONLY));
          if (fptr_rel == NULL
-             || !bfd_set_section_alignment (abfd, fptr_rel,
-                                            LOG_SECTION_ALIGN))
+             || !bfd_set_section_alignment (fptr_rel, LOG_SECTION_ALIGN))
            {
              BFD_ASSERT (0);
              return NULL;
@@ -2071,7 +2069,7 @@ get_pltoff (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED,
                                                    | SEC_SMALL_DATA
                                                    | SEC_LINKER_CREATED));
       if (!pltoff
-         || !bfd_set_section_alignment (abfd, pltoff, 4))
+         || !bfd_set_section_alignment (pltoff, 4))
        {
          BFD_ASSERT (0);
          return NULL;
@@ -2112,8 +2110,7 @@ get_reloc_section (bfd *abfd,
                                                  | SEC_LINKER_CREATED
                                                  | SEC_READONLY));
       if (srel == NULL
-         || !bfd_set_section_alignment (dynobj, srel,
-                                        LOG_SECTION_ALIGN))
+         || !bfd_set_section_alignment (srel, LOG_SECTION_ALIGN))
        return NULL;
     }
 
@@ -3171,7 +3168,7 @@ elfNN_ia64_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, sec);
+         name = bfd_section_name (sec);
 
          if (strcmp (name, ".got.plt") == 0)
            strip = FALSE;
index 1d04ae9b7eff7d3479c3aaf0401ac4badf31d096..ccf904af1bcc8c339f02945f8cfbac7f20ad7a88 100644 (file)
@@ -310,13 +310,13 @@ riscv_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
                                          (bed->dynamic_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->srelgot = s;
 
   s = s_got = bfd_make_section_anyway_with_flags (abfd, ".got", 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->sgot = s;
 
@@ -327,8 +327,7 @@ riscv_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
     {
       s = bfd_make_section_anyway_with_flags (abfd, ".got.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->sgotplt = s;
 
@@ -1840,7 +1839,7 @@ riscv_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);
        }
 
       resolved_to_zero = (h != NULL
@@ -3160,7 +3159,7 @@ _bfd_riscv_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;
index 1f6928071313d91479055e45aac4199590404bba..e7290aaab1d522d6c757a82647bbf86c138677de 100644 (file)
@@ -758,11 +758,9 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info,
              _("%F%P: failed to create GNU property section\n"));
 
           align = (bfd_get_mach (ebfd) & bfd_mach_aarch64_ilp32) ? 2 : 3;
-          if (!bfd_set_section_alignment (ebfd, sec, align))
-            {
-              info->callbacks->einfo (_("%F%pA: failed to align section\n"),
-                                      sec);
-            }
+         if (!bfd_set_section_alignment (sec, align))
+           info->callbacks->einfo (_("%F%pA: failed to align section\n"),
+                                   sec);
 
          elf_section_type (sec) = SHT_NOTE;
        }
index 8ad5268520b9b1cb3ea5fcce1049602e3dffa19b..496e42e7c5d50b273cdb62a586e5f58f093322b3 100644 (file)
@@ -1726,7 +1726,7 @@ section_allows_mips16_refs_p (asection *section)
 {
   const char *name;
 
-  name = bfd_get_section_name (section->owner, section);
+  name = bfd_section_name (section);
   return (FN_STUB_P (name)
          || CALL_STUB_P (name)
          || CALL_FP_STUB_P (name)
@@ -1937,7 +1937,7 @@ mips_elf_add_la25_intro (struct mips_elf_la25_stub *stub,
 
   /* Make sure that any padding goes before the stub.  */
   align = input_section->alignment_power;
-  if (!bfd_set_section_alignment (s->owner, s, align))
+  if (!bfd_set_section_alignment (s, align))
     return FALSE;
   if (align > 3)
     s->size = (1 << align) - 8;
@@ -1974,7 +1974,7 @@ mips_elf_add_la25_trampoline (struct mips_elf_la25_stub *stub,
       asection *input_section = stub->h->root.root.u.def.section;
       s = htab->add_stub_section (".text", NULL,
                                  input_section->output_section);
-      if (s == NULL || !bfd_set_section_alignment (s->owner, s, 4))
+      if (s == NULL || !bfd_set_section_alignment (s, 4))
        return FALSE;
       htab->strampoline = s;
     }
@@ -2992,7 +2992,7 @@ mips_elf_output_extsym (struct mips_elf_link_hash_entry *h, void *data)
            h->esym.asym.sc = scUndefined;
          else
            {
-             name = bfd_section_name (output_section->owner, output_section);
+             name = bfd_section_name (output_section);
 
              if (strcmp (name, ".text") == 0)
                h->esym.asym.sc = scText;
@@ -3265,8 +3265,8 @@ mips_elf_rel_dyn_section (struct bfd_link_info *info, bfd_boolean create_p)
                                                    | SEC_LINKER_CREATED
                                                    | SEC_READONLY));
       if (sreloc == NULL
-         || ! bfd_set_section_alignment (dynobj, sreloc,
-                                         MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
+         || !bfd_set_section_alignment (sreloc,
+                                        MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
        return NULL;
     }
   return sreloc;
@@ -5201,8 +5201,7 @@ mips_elf_create_compact_rel_section
 
       s = bfd_make_section_anyway_with_flags (abfd, ".compact_rel", flags);
       if (s == NULL
-         || ! bfd_set_section_alignment (abfd, s,
-                                         MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+         || !bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd)))
        return FALSE;
 
       s->size = sizeof (Elf32_External_compact_rel);
@@ -5236,7 +5235,7 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
      in the function stub generation and in the linker script.  */
   s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
   if (s == NULL
-      || ! bfd_set_section_alignment (abfd, s, 4))
+      || !bfd_set_section_alignment (s, 4))
     return FALSE;
   htab->root.sgot = s;
 
@@ -5537,7 +5536,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
                                                symtab_hdr->sh_link,
                                                sym->st_name);
       if (*namep == NULL || **namep == '\0')
-       *namep = bfd_section_name (input_bfd, sec);
+       *namep = bfd_section_name (sec);
 
       /* For relocations against a section symbol and ones against no
         symbol (absolute relocations) infer the ISA mode from the addend.  */
@@ -5735,7 +5734,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
              sec = NULL;
              for (o = input_bfd->sections; o != NULL; o = o->next)
                {
-                 if (CALL_FP_STUB_P (bfd_get_section_name (input_bfd, o)))
+                 if (CALL_FP_STUB_P (bfd_section_name (o)))
                    {
                      sec = h->call_fp_stub;
                      break;
@@ -7385,7 +7384,7 @@ _bfd_mips_elf_section_processing (bfd *abfd, Elf_Internal_Shdr *hdr)
 
   if (hdr->bfd_section != NULL)
     {
-      const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+      const char *name = bfd_section_name (hdr->bfd_section);
 
       /* .sbss is not handled specially here because the GNU/Linux
         prelinker can convert .sbss from NOBITS to PROGBITS and
@@ -7514,10 +7513,9 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
 
   if (flags)
     {
-      if (! bfd_set_section_flags (abfd, hdr->bfd_section,
-                                  (bfd_get_section_flags (abfd,
-                                                          hdr->bfd_section)
-                                   | flags)))
+      if (!bfd_set_section_flags (hdr->bfd_section,
+                                 (bfd_section_flags (hdr->bfd_section)
+                                  | flags)))
        return FALSE;
     }
 
@@ -7624,7 +7622,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd,
 bfd_boolean
 _bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
 {
-  const char *name = bfd_get_section_name (abfd, sec);
+  const char *name = bfd_section_name (sec);
 
   if (strcmp (name, ".liblist") == 0)
     {
@@ -7764,12 +7762,12 @@ bfd_boolean
 _bfd_mips_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_MIPS_SCOMMON;
       return TRUE;
     }
-  if (strcmp (bfd_get_section_name (abfd, sec), ".acommon") == 0)
+  if (strcmp (bfd_section_name (sec), ".acommon") == 0)
     {
       *retval = SHN_MIPS_ACOMMON;
       return TRUE;
@@ -7996,7 +7994,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_get_linker_section (abfd, ".dynamic");
       if (s != NULL)
        {
-         if (! bfd_set_section_flags (abfd, s, flags))
+         if (!bfd_set_section_flags (s, flags))
            return FALSE;
        }
     }
@@ -8013,8 +8011,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
                                          MIPS_ELF_STUB_SECTION_NAME (abfd),
                                          flags | SEC_CODE);
   if (s == NULL
-      || ! bfd_set_section_alignment (abfd, s,
-                                     MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+      || !bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd)))
     return FALSE;
   htab->sstubs = s;
 
@@ -8025,8 +8022,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       s = bfd_make_section_anyway_with_flags (abfd, ".rld_map",
                                              flags &~ (flagword) SEC_READONLY);
       if (s == NULL
-         || ! bfd_set_section_alignment (abfd, s,
-                                         MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+         || !bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd)))
        return FALSE;
     }
 
@@ -8069,24 +8065,24 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
       /* Change alignments of some sections.  */
       s = bfd_get_linker_section (abfd, ".hash");
       if (s != NULL)
-       (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+       bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
 
       s = bfd_get_linker_section (abfd, ".dynsym");
       if (s != NULL)
-       (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+       bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
 
       s = bfd_get_linker_section (abfd, ".dynstr");
       if (s != NULL)
-       (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+       bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
 
       /* ??? */
       s = bfd_get_section_by_name (abfd, ".reginfo");
       if (s != NULL)
-       (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+       bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
 
       s = bfd_get_linker_section (abfd, ".dynamic");
       if (s != NULL)
-       (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+       bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
     }
 
   if (bfd_link_executable (info))
@@ -8378,7 +8374,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 
   /* Check for the mips16 stub sections.  */
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
   if (FN_STUB_P (name))
     {
       unsigned long r_symndx;
@@ -9375,12 +9371,12 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
             Encourage better cache usage by aligning.  We do this
             lazily to avoid pessimizing traditional objects.  */
          if (!htab->is_vxworks
-             && !bfd_set_section_alignment (dynobj, htab->root.splt, 5))
+             && !bfd_set_section_alignment (htab->root.splt, 5))
            return FALSE;
 
          /* Make sure that .got.plt is word-aligned.  We do this lazily
             for the same reason as above.  */
-         if (!bfd_set_section_alignment (dynobj, htab->root.sgotplt,
+         if (!bfd_set_section_alignment (htab->root.sgotplt,
                                          MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
            return FALSE;
 
@@ -9588,7 +9584,7 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
   sect = bfd_get_section_by_name (output_bfd, ".reginfo");
   if (sect != NULL)
     {
-      bfd_set_section_size (output_bfd, sect, sizeof (Elf32_External_RegInfo));
+      bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo));
       sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
     }
 
@@ -9596,8 +9592,7 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
   sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
   if (sect != NULL)
     {
-      bfd_set_section_size (output_bfd, sect,
-                           sizeof (Elf_External_ABIFlags_v0));
+      bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0));
       sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
     }
 
@@ -10030,7 +10025,7 @@ _bfd_mips_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 ((s->flags & SEC_LINKER_CREATED) == 0)
        continue;
@@ -10048,8 +10043,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
                 assert a DT_TEXTREL entry rather than testing whether
                 there exists a relocation to a read only section or
                 not.  */
-             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 + 4);
              if ((target != NULL
                   && (target->flags & SEC_READONLY) != 0
@@ -12445,7 +12439,7 @@ _bfd_mips_final_write_processing (bfd *abfd)
 
        case SHT_MIPS_GPTAB:
          BFD_ASSERT ((*hdrpp)->bfd_section != NULL);
-         name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section);
+         name = bfd_section_name ((*hdrpp)->bfd_section);
          BFD_ASSERT (name != NULL
                      && CONST_STRNEQ (name, ".gptab."));
          sec = bfd_get_section_by_name (abfd, name + sizeof ".gptab" - 1);
@@ -12455,7 +12449,7 @@ _bfd_mips_final_write_processing (bfd *abfd)
 
        case SHT_MIPS_CONTENT:
          BFD_ASSERT ((*hdrpp)->bfd_section != NULL);
-         name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section);
+         name = bfd_section_name ((*hdrpp)->bfd_section);
          BFD_ASSERT (name != NULL
                      && CONST_STRNEQ (name, ".MIPS.content"));
          sec = bfd_get_section_by_name (abfd,
@@ -12475,7 +12469,7 @@ _bfd_mips_final_write_processing (bfd *abfd)
 
        case SHT_MIPS_EVENTS:
          BFD_ASSERT ((*hdrpp)->bfd_section != NULL);
-         name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section);
+         name = bfd_section_name ((*hdrpp)->bfd_section);
          BFD_ASSERT (name != NULL);
          if (CONST_STRNEQ (name, ".MIPS.events"))
            sec = bfd_get_section_by_name (abfd,
@@ -12861,8 +12855,7 @@ _bfd_mips_elf_gc_mark_extra_sections (struct bfd_link_info *info,
 
       for (o = sub->sections; o != NULL; o = o->next)
        if (!o->gc_mark
-           && MIPS_ELF_ABIFLAGS_SECTION_NAME_P
-                (bfd_get_section_name (sub, o)))
+           && MIPS_ELF_ABIFLAGS_SECTION_NAME_P (bfd_section_name (o)))
          {
            if (!_bfd_elf_gc_mark (info, o, gc_mark_hook))
              return FALSE;
@@ -15024,7 +15017,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
                                                                   ".rtproc",
                                                                   flags);
                  if (rtproc_sec == NULL
-                     || ! bfd_set_section_alignment (abfd, rtproc_sec, 4))
+                     || !bfd_set_section_alignment (rtproc_sec, 4))
                    return FALSE;
                }
 
index e479884071da97f308d1b6068c33928e8f4e9659..735e83f3de5cc9866d4ed34240aec001626c5136 100644 (file)
@@ -1263,15 +1263,14 @@ create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
 
   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;
 
   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;
 
@@ -4164,8 +4163,7 @@ do_relocation:
                     || r_type == R_SPARC_UA32
                     || r_type == R_SPARC_DISP32)
                    && (((input_section->flags & SEC_DEBUGGING) != 0
-                        && strcmp (bfd_section_name (input_bfd,
-                                                     input_section),
+                        && strcmp (bfd_section_name (input_section),
                                    ".stab") == 0)
                        || _bfd_elf_section_offset (output_bfd, info,
                                                    input_section,
@@ -4194,7 +4192,7 @@ do_relocation:
                    if (name == NULL)
                      return FALSE;
                    if (*name == '\0')
-                     name = bfd_section_name (input_bfd, sec);
+                     name = bfd_section_name (sec);
                  }
                (*info->callbacks->reloc_overflow)
                  (info, (h ? &h->root : NULL), name, howto->name,
index 2149fbcd2261a9714578397cd1d242729e91d3e3..41af167e1e187df686df92302b544611134f3ef9 100644 (file)
@@ -1438,13 +1438,13 @@ tilegx_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
                                          (bed->dynamic_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->srelgot = s;
 
   s = s_got = bfd_make_section_anyway_with_flags (abfd, ".got", 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->sgot = s;
 
@@ -1455,8 +1455,7 @@ tilegx_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
     {
       s = bfd_make_section_anyway_with_flags (abfd, ".got.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->sgotplt = s;
 
@@ -3032,7 +3031,7 @@ tilegx_elf_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_type)
index 634f911ca5395cf0f1ef738fda2511b102e44b93..d8165d17528006689572634db163274fdc004033 100644 (file)
@@ -1238,7 +1238,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd *output_bfd,
        {
          /* Strip these too.  */
        }
-      else if (htab->is_reloc_section (bfd_get_section_name (dynobj, s)))
+      else if (htab->is_reloc_section (bfd_section_name (s)))
        {
          if (s->size != 0
              && s != htab->elf.srelplt
@@ -1280,8 +1280,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd *output_bfd,
         it is empty.  Update its section alignment now since it
         is non-empty.  */
       if (s == htab->elf.iplt)
-       bfd_set_section_alignment (s->owner, s,
-                                  htab->plt.iplt_alignment);
+       bfd_set_section_alignment (s, htab->plt.iplt_alignment);
 
       /* Allocate memory for the section contents.  We use bfd_zalloc
         here in case unused entries are not reclaimed before the
@@ -2625,7 +2624,7 @@ _bfd_x86_elf_link_setup_gnu_properties
          if (sec == NULL)
            info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
 
-         if (!bfd_set_section_alignment (ebfd, sec, class_align))
+         if (!bfd_set_section_alignment (sec, class_align))
            {
 error_alignment:
              info->callbacks->einfo (_("%F%pA: failed to align section\n"),
@@ -2839,11 +2838,11 @@ error_alignment:
      instead of in create_dynamic_sections so that they are always
      properly aligned even if create_dynamic_sections isn't called.  */
   sec = htab->elf.sgot;
-  if (!bfd_set_section_alignment (dynobj, sec, got_align))
+  if (!bfd_set_section_alignment (sec, got_align))
     goto error_alignment;
 
   sec = htab->elf.sgotplt;
-  if (!bfd_set_section_alignment (dynobj, sec, got_align))
+  if (!bfd_set_section_alignment (sec, got_align))
     goto error_alignment;
 
   /* Create the ifunc sections here so that check_relocs can be
@@ -2881,8 +2880,7 @@ error_alignment:
            = bfd_log2 (htab->non_lazy_plt->plt_entry_size);
 
          sec = pltsec;
-         if (!bfd_set_section_alignment (sec->owner, sec,
-                                         plt_alignment))
+         if (!bfd_set_section_alignment (sec, plt_alignment))
            goto error_alignment;
 
          /* Create the GOT procedure linkage table.  */
@@ -2892,8 +2890,7 @@ error_alignment:
          if (sec == NULL)
            info->callbacks->einfo (_("%F%P: failed to create GOT PLT section\n"));
 
-         if (!bfd_set_section_alignment (dynobj, sec,
-                                         non_lazy_plt_alignment))
+         if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
            goto error_alignment;
 
          htab->plt_got = sec;
@@ -2913,8 +2910,7 @@ error_alignment:
                  if (sec == NULL)
                    info->callbacks->einfo (_("%F%P: failed to create IBT-enabled PLT section\n"));
 
-                 if (!bfd_set_section_alignment (dynobj, sec,
-                                                 plt_alignment))
+                 if (!bfd_set_section_alignment (sec, plt_alignment))
                    goto error_alignment;
                }
              else if (htab->params->bndplt && ABI_64_P (dynobj))
@@ -2928,8 +2924,7 @@ error_alignment:
                  if (sec == NULL)
                    info->callbacks->einfo (_("%F%P: failed to create BND PLT section\n"));
 
-                 if (!bfd_set_section_alignment (dynobj, sec,
-                                                 non_lazy_plt_alignment))
+                 if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
                    goto error_alignment;
                }
 
@@ -2949,7 +2944,7 @@ error_alignment:
          if (sec == NULL)
            info->callbacks->einfo (_("%F%P: failed to create PLT .eh_frame section\n"));
 
-         if (!bfd_set_section_alignment (dynobj, sec, class_align))
+         if (!bfd_set_section_alignment (sec, class_align))
            goto error_alignment;
 
          htab->plt_eh_frame = sec;
@@ -2962,7 +2957,7 @@ error_alignment:
              if (sec == NULL)
                info->callbacks->einfo (_("%F%P: failed to create GOT PLT .eh_frame section\n"));
 
-             if (!bfd_set_section_alignment (dynobj, sec, class_align))
+             if (!bfd_set_section_alignment (sec, class_align))
                goto error_alignment;
 
              htab->plt_got_eh_frame = sec;
@@ -2976,7 +2971,7 @@ error_alignment:
              if (sec == NULL)
                info->callbacks->einfo (_("%F%P: failed to create the second PLT .eh_frame section\n"));
 
-             if (!bfd_set_section_alignment (dynobj, sec, class_align))
+             if (!bfd_set_section_alignment (sec, class_align))
                goto error_alignment;
 
              htab->plt_second_eh_frame = sec;
@@ -2995,7 +2990,7 @@ error_alignment:
         section backwards, resulting in a warning and section lma not
         being set properly.  It later leads to a "File truncated"
         error.  */
-      if (!bfd_set_section_alignment (sec->owner, sec, 0))
+      if (!bfd_set_section_alignment (sec, 0))
        goto error_alignment;
 
       htab->plt.iplt_alignment = (normal_target
index 9c4ab4cecec63465eacd3b2b3215df3c0a64021c..18f332f60d302f8c4c7c240479478f191f57c905 100644 (file)
@@ -109,7 +109,7 @@ msdos_object_p (bfd *abfd)
       return NULL;
     }
 
-  bfd_set_section_size (abfd, section, size);
+  bfd_set_section_size (section, size);
   section->alignment_power = 4;
 
   return abfd->xvec;
@@ -135,16 +135,16 @@ msdos_write_object_contents (bfd *abfd)
     {
       if (sec->size == 0)
        continue;
-      if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+      if (bfd_section_flags (sec) & SEC_ALLOC)
        {
-         bfd_vma sec_vma = bfd_get_section_vma (abfd, sec) + sec->size;
+         bfd_vma sec_vma = bfd_section_vma (sec) + sec->size;
          if (sec_vma > high_vma)
            high_vma = sec_vma;
        }
-      if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
+      if (bfd_section_flags (sec) & SEC_LOAD)
        {
          file_ptr sec_end = (sizeof (hdr)
-                             + bfd_get_section_vma (abfd, sec)
+                             + bfd_section_vma (sec)
                              + sec->size);
          if (sec_end > outfile_size)
            outfile_size = sec_end;
@@ -195,9 +195,9 @@ msdos_set_section_contents (bfd *abfd,
   if (count == 0)
     return TRUE;
 
-  section->filepos = EXE_PAGE_SIZE + bfd_get_section_vma (abfd, section);
+  section->filepos = EXE_PAGE_SIZE + bfd_section_vma (section);
 
-  if (bfd_get_section_flags (abfd, section) & SEC_LOAD)
+  if (bfd_section_flags (section) & SEC_LOAD)
     {
       if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
          || bfd_bwrite (location, count, abfd) != count)
index 2518371f247e2f81c3cd09a29414d8d7bc704c03..143b8eb950e993ae0c5f6fde07023dbb4549ef16 100644 (file)
@@ -2396,7 +2396,7 @@ _bfd_generic_reloc_link_order (bfd *abfd,
          (*info->callbacks->reloc_overflow)
            (info, NULL,
             (link_order->type == bfd_section_reloc_link_order
-             ? bfd_section_name (abfd, link_order->u.reloc.p->u.section)
+             ? bfd_section_name (link_order->u.reloc.p->u.section)
              : link_order->u.reloc.p->u.name),
             r->howto->name, link_order->u.reloc.p->addend,
             NULL, NULL, 0);
@@ -2942,7 +2942,7 @@ _bfd_generic_section_already_linked (bfd *abfd ATTRIBUTE_UNUSED,
      into a single large link once section, which defeats the purpose
      of having link once sections in the first place.  */
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   already_linked_list = bfd_section_already_linked_table_lookup (name);
 
index 7d70087c95e151ac8c3ceb8fe0754251d69de5aa..117e410d834378e11810595289eac424693279af 100644 (file)
@@ -437,7 +437,7 @@ bfd_mach_o_convert_section_name_to_mach_o (bfd *abfd ATTRIBUTE_UNUSED,
                                           bfd_mach_o_section *section)
 {
   const mach_o_section_name_xlat *xlat;
-  const char *name = bfd_get_section_name (abfd, sect);
+  const char *name = bfd_section_name (sect);
   const char *segname;
   const char *dot;
   unsigned int len;
@@ -2583,13 +2583,13 @@ bfd_mach_o_mangle_sections (bfd *abfd, bfd_mach_o_data_struct *mdata)
   target_index = 0;
   for (sec = abfd->sections; sec; sec = sec->next)
     {
-      unsigned bfd_align = bfd_get_section_alignment (abfd, sec);
+      unsigned bfd_align = bfd_section_alignment (sec);
       bfd_mach_o_section *msect = bfd_mach_o_get_mach_o_section (sec);
 
       mdata->sections[target_index] = msect;
 
-      msect->addr = bfd_get_section_vma (abfd, sec);
-      msect->size = bfd_get_section_size (sec);
+      msect->addr = bfd_section_vma (sec);
+      msect->size = bfd_section_size (sec);
 
       /* Use the largest alignment set, in case it was bumped after the
         section was created.  */
@@ -2808,7 +2808,7 @@ bfd_mach_o_set_section_flags_from_bfd (bfd *abfd ATTRIBUTE_UNUSED,
   bfd_mach_o_section *s = bfd_mach_o_get_mach_o_section (sec);
 
   /* Create default flags.  */
-  bfd_flags = bfd_get_section_flags (abfd, sec);
+  bfd_flags = bfd_section_flags (sec);
   if ((bfd_flags & SEC_CODE) == SEC_CODE)
     s->flags = BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS
       | BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS
@@ -2983,7 +2983,7 @@ bfd_mach_o_build_exec_seg_command (bfd *abfd, bfd_mach_o_segment_command *seg)
   for (s = seg->sect_head; s != NULL; s = s->next)
     {
       asection *sec = s->bfdsection;
-      flagword flags = bfd_get_section_flags (abfd, sec);
+      flagword flags = bfd_section_flags (sec);
 
       /* Adjust segment size.  */
       seg->vmsize = FILE_ALIGN (seg->vmsize, s->align);
@@ -3502,7 +3502,7 @@ bfd_boolean
 bfd_mach_o_new_section_hook (bfd *abfd, asection *sec)
 {
   bfd_mach_o_section *s;
-  unsigned bfdalign = bfd_get_section_alignment (abfd, sec);
+  unsigned bfdalign = bfd_section_alignment (sec);
 
   s = bfd_mach_o_get_mach_o_section (sec);
   if (s == NULL)
@@ -3526,10 +3526,10 @@ bfd_mach_o_new_section_hook (bfd *abfd, asection *sec)
          s->flags = xlat->macho_sectype | xlat->macho_secattr;
          s->align = xlat->sectalign > bfdalign ? xlat->sectalign
                                                : bfdalign;
-         (void) bfd_set_section_alignment (abfd, sec, s->align);
-         bfd_flags = bfd_get_section_flags (abfd, sec);
+         bfd_set_section_alignment (sec, s->align);
+         bfd_flags = bfd_section_flags (sec);
          if (bfd_flags == SEC_NO_FLAGS)
-           bfd_set_section_flags (abfd, sec, xlat->bfd_flags);
+           bfd_set_section_flags (sec, xlat->bfd_flags);
        }
       else
        /* Create default flags.  */
@@ -3540,13 +3540,12 @@ bfd_mach_o_new_section_hook (bfd *abfd, asection *sec)
 }
 
 static void
-bfd_mach_o_init_section_from_mach_o (bfd *abfd, asection *sec,
-                                    unsigned long prot)
+bfd_mach_o_init_section_from_mach_o (asection *sec, unsigned long prot)
 {
   flagword flags;
   bfd_mach_o_section *section;
 
-  flags = bfd_get_section_flags (abfd, sec);
+  flags = bfd_section_flags (sec);
   section = bfd_mach_o_get_mach_o_section (sec);
 
   /* TODO: see if we should use the xlat system for doing this by
@@ -3584,7 +3583,7 @@ bfd_mach_o_init_section_from_mach_o (bfd *abfd, asection *sec,
   if (section->nreloc != 0)
     flags |= SEC_RELOC;
 
-  bfd_set_section_flags (abfd, sec, flags);
+  bfd_set_section_flags (sec, flags);
 
   sec->vma = section->addr;
   sec->lma = section->addr;
@@ -3651,7 +3650,7 @@ bfd_mach_o_read_section_32 (bfd *abfd, unsigned long prot)
   section->reserved2 = bfd_h_get_32 (abfd, raw.reserved2);
   section->reserved3 = 0;
 
-  bfd_mach_o_init_section_from_mach_o (abfd, sec, prot);
+  bfd_mach_o_init_section_from_mach_o (sec, prot);
 
   return sec;
 }
@@ -3694,7 +3693,7 @@ bfd_mach_o_read_section_64 (bfd *abfd, unsigned long prot)
   section->reserved2 = bfd_h_get_32 (abfd, raw.reserved2);
   section->reserved3 = bfd_h_get_32 (abfd, raw.reserved3);
 
-  bfd_mach_o_init_section_from_mach_o (abfd, sec, prot);
+  bfd_mach_o_init_section_from_mach_o (sec, prot);
 
   return sec;
 }
index f48f9868fee2854cefbea4dbdcc302b4ca4f7d86..736ee4bed8194cb61e18891f00ea074416bfce1e 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -596,7 +596,7 @@ static bfd_boolean
 mmo_section_has_contents (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *p ATTRIBUTE_UNUSED)
 {
   /* The point is to match what --extract-symbols does (well, negated).  */
-  return bfd_get_section_size (sec) != 0;
+  return bfd_section_size (sec) != 0;
 }
 
 /* Find out whether we should omit symbol consistency checks for this
@@ -642,10 +642,10 @@ static void
 mmo_find_sec_w_addr (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *p)
 {
   struct mmo_find_sec_info *infop = (struct mmo_find_sec_info *) p;
-  bfd_vma vma = bfd_get_section_vma (abfd, sec);
+  bfd_vma vma = bfd_section_vma (sec);
 
   /* Ignore sections that aren't loaded.  */
-  if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC))
+  if ((bfd_section_flags (sec) & (SEC_LOAD | SEC_ALLOC))
       !=  (SEC_LOAD | SEC_ALLOC))
     return;
 
@@ -657,10 +657,10 @@ static void
 mmo_find_sec_w_addr_grow (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *p)
 {
   struct mmo_find_sec_info *infop = (struct mmo_find_sec_info *) p;
-  bfd_vma vma = bfd_get_section_vma (abfd, sec);
+  bfd_vma vma = bfd_section_vma (sec);
 
   /* Ignore sections that aren't loaded.  */
-  if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC))
+  if ((bfd_section_flags (sec) & (SEC_LOAD | SEC_ALLOC))
       !=  (SEC_LOAD | SEC_ALLOC))
     return;
 
@@ -700,12 +700,11 @@ mmo_decide_section (bfd *abfd, bfd_vma vma)
       if (sec == NULL)
        return NULL;
 
-      if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+      if (!sec->user_set_vma && !bfd_set_section_vma (sec, vma))
        return NULL;
 
-      if (! bfd_set_section_flags (abfd, sec,
-                                  bfd_get_section_flags (abfd, sec)
-                                  | SEC_CODE | SEC_LOAD | SEC_ALLOC))
+      if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+                                       | SEC_CODE | SEC_LOAD | SEC_ALLOC)))
        return NULL;
     }
   else if ((vma >> 56) == 0x20)
@@ -715,12 +714,11 @@ mmo_decide_section (bfd *abfd, bfd_vma vma)
       if (sec == NULL)
        return NULL;
 
-      if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+      if (!sec->user_set_vma && !bfd_set_section_vma (sec, vma))
        return NULL;
 
-      if (! bfd_set_section_flags (abfd, sec,
-                                  bfd_get_section_flags (abfd, sec)
-                                  | SEC_LOAD | SEC_ALLOC))
+      if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+                                       | SEC_LOAD | SEC_ALLOC)))
        return NULL;
     }
 
@@ -733,12 +731,11 @@ mmo_decide_section (bfd *abfd, bfd_vma vma)
   sprintf (sec_name, ".MMIX.sec.%d", abfd->tdata.mmo_data->sec_no++);
   sec = mmo_make_section (abfd, sec_name);
 
-  if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+  if (!sec->user_set_vma && !bfd_set_section_vma (sec, vma))
     return NULL;
 
-  if (! bfd_set_section_flags (abfd, sec,
-                              bfd_get_section_flags (abfd, sec)
-                              | SEC_LOAD | SEC_ALLOC))
+  if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+                                   | SEC_LOAD | SEC_ALLOC)))
     return NULL;
   return sec;
 }
@@ -1136,14 +1133,13 @@ mmo_get_spec_section (bfd *abfd, int spec_data_number)
 
   /* Add in the section flags we found to those bfd entered during this
      process and set the contents.  */
-  if (! bfd_set_section_flags (abfd, sec,
-                              bfd_sec_flags_from_mmo_flags (flags)
-                              | bfd_get_section_flags (abfd, sec)
-                              | (section_length != 0 ? SEC_HAS_CONTENTS : 0))
-      || ! bfd_set_section_size (abfd, sec, sec->size + section_length)
+  if (!bfd_set_section_flags (sec,
+                             (bfd_sec_flags_from_mmo_flags (flags)
+                              | bfd_section_flags (sec)
+                              | (section_length != 0 ? SEC_HAS_CONTENTS : 0)))
+      || !bfd_set_section_size (sec, sec->size + section_length)
       /* Set VMA only for the first occurrence.  */
-      || (! sec->user_set_vma
-         && ! bfd_set_section_vma  (abfd, sec, section_vma)))
+      || (!sec->user_set_vma && !bfd_set_section_vma (sec, section_vma)))
     {
       /* If we get an error for any of the calls above, signal more than
         just a format error for the spec section.  */
@@ -1561,9 +1557,8 @@ mmo_get_loc (asection *sec, bfd_vma vma, int size)
 
          /* We get here for the first time (at other times too) for this
             section.  Say we have contents.  */
-         if (! bfd_set_section_flags (sec->owner, sec,
-                                      bfd_get_section_flags (sec->owner, sec)
-                                      | SEC_HAS_CONTENTS))
+         if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+                                           | SEC_HAS_CONTENTS)))
            return NULL;
        }
     }
@@ -2070,18 +2065,16 @@ mmo_scan (bfd *abfd)
      section flags must be set then.  */
   sec = bfd_get_section_by_name (abfd, MMO_TEXT_SECTION_NAME);
   if (sec != NULL
-      && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
-      && ! bfd_set_section_flags (abfd, sec,
-                                 bfd_get_section_flags (abfd, sec)
-                                 | SEC_ALLOC | SEC_LOAD | SEC_CODE))
+      && (bfd_section_flags (sec) & SEC_HAS_CONTENTS)
+      && !bfd_set_section_flags (sec, (bfd_section_flags (sec)
+                                      | SEC_ALLOC | SEC_LOAD | SEC_CODE)))
     error = TRUE;
 
   sec = bfd_get_section_by_name (abfd, MMO_DATA_SECTION_NAME);
   if (sec != NULL
-      && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
-      && ! bfd_set_section_flags (abfd, sec,
-                                 bfd_get_section_flags (abfd, sec)
-                                 | SEC_ALLOC | SEC_LOAD))
+      && (bfd_section_flags (sec) & SEC_HAS_CONTENTS)
+      && !bfd_set_section_flags (sec, (bfd_section_flags (sec)
+                                      | SEC_ALLOC | SEC_LOAD)))
     error = TRUE;
 
   /* Free whatever resources we took.  */
@@ -2432,7 +2425,7 @@ bfd_sec_flags_from_mmo_flags (flagword flags)
 static bfd_boolean
 mmo_has_leading_or_trailing_zero_tetra_p (bfd *abfd, asection *sec)
 {
-  bfd_vma secaddr = bfd_get_section_vma (abfd, sec);
+  bfd_vma secaddr = bfd_section_vma (sec);
 
   if (sec->size < 4)
     return FALSE;
@@ -2464,7 +2457,7 @@ mmo_internal_write_section (bfd *abfd, asection *sec)
 
   if (strcmp (sec->name, MMO_TEXT_SECTION_NAME) == 0)
     {
-      bfd_vma secaddr = bfd_get_section_vma (abfd, sec);
+      bfd_vma secaddr = bfd_section_vma (sec);
 
       /* Because leading and trailing zeros are omitted in output, we need to
         specify the section boundaries so they're correct when the file
@@ -2485,7 +2478,7 @@ mmo_internal_write_section (bfd *abfd, asection *sec)
     }
   else if (strcmp (sec->name, MMO_DATA_SECTION_NAME) == 0)
     {
-      bfd_vma secaddr = bfd_get_section_vma (abfd, sec);
+      bfd_vma secaddr = bfd_section_vma (sec);
 
       /* Same goes as for MMO_TEXT_SECTION_NAME above.  */
       if (sec->size != 0
@@ -2519,7 +2512,7 @@ mmo_internal_write_section (bfd *abfd, asection *sec)
     }
   /* Ignore sections that are just allocated or empty; we write out
      _contents_ here.  */
-  else if ((bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) != 0
+  else if ((bfd_section_flags (sec) & SEC_HAS_CONTENTS) != 0
           && sec->size != 0)
     {
       if (!mmo_write_section_description (abfd, sec))
@@ -2527,7 +2520,7 @@ mmo_internal_write_section (bfd *abfd, asection *sec)
 
       /* Writing a LOP_LOC ends the LOP_SPEC data, and makes data actually
         loaded.  */
-      if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
+      if (bfd_section_flags (sec) & SEC_LOAD)
        return (! abfd->tdata.mmo_data->have_error
                && mmo_write_loc_chunk_list (abfd,
                                         mmo_section_data (sec)->head));
@@ -2646,10 +2639,9 @@ EXAMPLE
      for all alien sections; perhaps mmo.em should clear that flag.  Might
      be related to weak references.  */
   mmo_write_tetra (abfd,
-                  mmo_sec_flags_from_bfd_flags
-                  (bfd_get_section_flags (abfd, sec)));
+                  mmo_sec_flags_from_bfd_flags (bfd_section_flags (sec)));
   mmo_write_octa (abfd, sec->size);
-  mmo_write_octa (abfd, bfd_get_section_vma (abfd, sec));
+  mmo_write_octa (abfd, bfd_section_vma (sec));
   return TRUE;
 }
 
@@ -3171,7 +3163,7 @@ mmo_write_section_unless_reg_contents (bfd *abfd, asection *sec, void *p)
   /* Exclude the convenience register section.  */
   if (strcmp (sec->name, MMIX_REG_SECTION_NAME) == 0)
     {
-      if (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
+      if (bfd_section_flags (sec) & SEC_HAS_CONTENTS)
        {
          /* Make sure it hasn't got contents.  It seems impossible to
             make it carry contents, so we don't have a test-case for
index d14dfe932066dbb964f9e14fb8d505ec298fc29b..b537dfd96d1f0cc2f2f2501a1c1cb6d6f53aa22b 100644 (file)
@@ -1218,7 +1218,7 @@ bfd_get_debug_link_info_1 (bfd *abfd, void *crc32_out)
   if (sect == NULL)
     return NULL;
 
-  size = bfd_get_section_size (sect);
+  size = bfd_section_size (sect);
 
   /* PR 22794: Make sure that the section has a reasonable size.  */
   if (size < 8 || size >= bfd_get_size (abfd))
@@ -1308,7 +1308,7 @@ bfd_get_alt_debug_link_info (bfd * abfd, bfd_size_type *buildid_len,
   if (sect == NULL)
     return NULL;
 
-  size = bfd_get_section_size (sect);
+  size = bfd_section_size (sect);
   if (size < 8 || size >= bfd_get_size (abfd))
     return NULL;
 
@@ -1322,7 +1322,7 @@ bfd_get_alt_debug_link_info (bfd * abfd, bfd_size_type *buildid_len,
   /* BuildID value is stored after the filename.  */
   name = (char *) contents;
   buildid_offset = strnlen (name, size) + 1;
-  if (buildid_offset >= bfd_get_section_size (sect))
+  if (buildid_offset >= bfd_section_size (sect))
     return NULL;
 
   *buildid_len = size - buildid_offset;
@@ -1727,14 +1727,14 @@ bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename)
   debuglink_size &= ~3;
   debuglink_size += 4;
 
-  if (! bfd_set_section_size (abfd, sect, debuglink_size))
+  if (!bfd_set_section_size (sect, debuglink_size))
     /* XXX Should we delete the section from the bfd ?  */
     return NULL;
 
   /* PR 21193: Ensure that the section has 4-byte alignment for the CRC.
      Note - despite the name of the function being called, we are
      setting an alignment power, not a byte alignment value.  */
-  bfd_set_section_alignment (abfd, sect, 2);
+  bfd_set_section_alignment (sect, 2);
 
   return sect;
 }
@@ -1872,7 +1872,7 @@ get_build_id (bfd *abfd)
       return NULL;
     }
 
-  size = bfd_get_section_size (sect);
+  size = bfd_section_size (sect);
   /* FIXME: Should we support smaller build-id notes ?  */
   if (size < 0x24)
     {
@@ -1890,7 +1890,7 @@ get_build_id (bfd *abfd)
   /* FIXME: Paranoia - allow for compressed build-id sections.
      Maybe we should complain if this size is different from
      the one obtained above...  */
-  size = bfd_get_section_size (sect);
+  size = bfd_section_size (sect);
   if (size < sizeof (Elf_External_Note))
     {
       bfd_set_error (bfd_error_invalid_operation);
index 238f5144d4cb3c089535cd78c0fb32aa9594fea2..a0c3ac0fa66b2062b310d91df677ae4e1cba4965 100644 (file)
@@ -2802,17 +2802,17 @@ 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:
          /* 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;
        }
 
@@ -3151,8 +3151,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,
             (asection *) NULL, (bfd_vma) 0);
@@ -3477,7 +3476,7 @@ pdp11_aout_link_input_section (struct aout_final_link_info *flaginfo,
                    asection *s;
 
                    s = aout_reloc_type_to_section (input_bfd, r_type);
-                   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,
@@ -3997,8 +3996,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);
@@ -4206,7 +4204,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
index 2588e6c6e904bd9fc9b4d3c3b23d47b62a4f286e..c0b97351defb044a4498fc70908ed89dfc83526e 100644 (file)
@@ -770,7 +770,7 @@ pex64_bfd_print_pdata_section (bfd *abfd, void *vfile, asection *pdata_section)
          if (PEX64_IS_RUNTIME_FUNCTION_CHAINED (&rf))
            {
              bfd_vma altent = PEX64_GET_UNWINDDATA_UNIFIED_RVA (&rf);
-             bfd_vma pdata_vma = bfd_get_section_vma (abfd, pdata_section);
+             bfd_vma pdata_vma = bfd_section_vma (pdata_section);
              struct pex64_runtime_function arf;
 
              fprintf (file, "\t shares information with ");
index 679474ecd152892e0e1a881260ee4b672238d967..1e2b104430235b8e0b8ae62fa720e90a1a83c665 100644 (file)
@@ -608,16 +608,16 @@ pe_ILF_make_a_section (pe_ILF_vars * vars,
 
   flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_KEEP | SEC_IN_MEMORY;
 
-  bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
+  bfd_set_section_flags (sec, flags | extra_flags);
 
-  (void) bfd_set_section_alignment (vars->abfd, sec, 2);
+  bfd_set_section_alignment (sec, 2);
 
   /* Check that we will not run out of space.  */
   BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
 
   /* Set the section size and contents.  The actual
      contents are filled in by our parent.  */
-  bfd_set_section_size (vars->abfd, sec, (bfd_size_type) size);
+  bfd_set_section_size (sec, (bfd_size_type) size);
   sec->contents = vars->data;
   sec->target_index = vars->sec_index ++;
 
index 8eac73ddfe588cc96e3e0df91d9d44cce2545093..0c67ecd313ab1a3281baa38878574c4aa0d20c4e 100644 (file)
@@ -1526,8 +1526,7 @@ _bfd_clear_contents (reloc_howto_type *howto,
 
   /* For a range list, use 1 instead of 0 as placeholder.  0
      would terminate the list, hiding any later entries.  */
-  if (strcmp (bfd_get_section_name (input_bfd, input_section),
-             ".debug_ranges") == 0
+  if (strcmp (bfd_section_name (input_section), ".debug_ranges") == 0
       && (howto->dst_mask & 1) != 0)
     x |= 1;
 
index 74feb73be9061529b7cbdca72ee6c523862a8e12..3a9cb26023453746e30ebf9ff56f072e53a0d141 100644 (file)
@@ -554,26 +554,31 @@ CODE_FRAGMENT
 .   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)
 .{
-.  ptr->userdata = val;
+.  sec->userdata = val;
 .  return TRUE;
 .}
 .
 .static inline bfd_boolean
-.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+.bfd_set_section_vma (asection *sec, bfd_vma val)
 .{
-.  ptr->vma = ptr->lma = val;
-.  ptr->user_set_vma = TRUE;
+.  sec->vma = sec->lma = val;
+.  sec->user_set_vma = TRUE;
 .  return TRUE;
 .}
 .
 .static inline bfd_boolean
-.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
-.                          unsigned int val)
+.bfd_set_section_lma (asection *sec, bfd_vma val)
 .{
-.  ptr->alignment_power = val;
+.  sec->lma = val;
+.  return TRUE;
+.}
+.
+.static inline bfd_boolean
+.bfd_set_section_alignment (asection *sec, unsigned int val)
+.{
+.  sec->alignment_power = val;
 .  return TRUE;
 .}
 .
@@ -1289,13 +1294,12 @@ FUNCTION
        bfd_set_section_flags
 
 SYNOPSIS
-       bfd_boolean bfd_set_section_flags
-         (bfd *abfd, asection *sec, flagword flags);
+       bfd_boolean bfd_set_section_flags (asection *sec, flagword flags);
 
 DESCRIPTION
-       Set the attributes of the section @var{sec} in the BFD
-       @var{abfd} to the value @var{flags}. Return <<TRUE>> on success,
-       <<FALSE>> on error. Possible error returns are:
+       Set the attributes of the section @var{sec} to the value @var{flags}.
+       Return <<TRUE>> on success, <<FALSE>> on error.  Possible error
+       returns are:
 
        o <<bfd_error_invalid_operation>> -
        The section cannot have one or more of the attributes
@@ -1305,9 +1309,7 @@ DESCRIPTION
 */
 
 bfd_boolean
-bfd_set_section_flags (bfd *abfd ATTRIBUTE_UNUSED,
-                      sec_ptr section,
-                      flagword flags)
+bfd_set_section_flags (asection *section, flagword flags)
 {
   section->flags = flags;
   return TRUE;
@@ -1319,21 +1321,21 @@ FUNCTION
 
 SYNOPSIS
        void bfd_rename_section
-         (bfd *abfd, asection *sec, const char *newname);
+         (asection *sec, const char *newname);
 
 DESCRIPTION
-       Rename section @var{sec} in @var{abfd} to @var{newname}.
+       Rename section @var{sec} to @var{newname}.
 */
 
 void
-bfd_rename_section (bfd *abfd, sec_ptr sec, const char *newname)
+bfd_rename_section (asection *sec, const char *newname)
 {
   struct section_hash_entry *sh;
 
   sh = (struct section_hash_entry *)
     ((char *) sec - offsetof (struct section_hash_entry, section));
   sh->section.name = newname;
-  bfd_hash_rename (&abfd->section_htab, newname, &sh->root);
+  bfd_hash_rename (&sec->owner->section_htab, newname, &sh->root);
 }
 
 /*
@@ -1417,8 +1419,7 @@ FUNCTION
        bfd_set_section_size
 
 SYNOPSIS
-       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);
 
 DESCRIPTION
        Set @var{sec} to the size @var{val}. If the operation is
@@ -1431,18 +1432,18 @@ DESCRIPTION
 */
 
 bfd_boolean
-bfd_set_section_size (bfd *abfd, sec_ptr ptr, bfd_size_type val)
+bfd_set_section_size (asection *sec, bfd_size_type val)
 {
   /* Once you've started writing to any section you cannot create or change
      the size of any others.  */
 
-  if (abfd->output_has_begun)
+  if (sec->owner == NULL || sec->owner->output_has_begun)
     {
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
     }
 
-  ptr->size = val;
+  sec->size = val;
   return TRUE;
 }
 
@@ -1486,7 +1487,7 @@ bfd_set_section_contents (bfd *abfd,
 {
   bfd_size_type sz;
 
-  if (!(bfd_get_section_flags (abfd, section) & SEC_HAS_CONTENTS))
+  if (!(bfd_section_flags (section) & SEC_HAS_CONTENTS))
     {
       bfd_set_error (bfd_error_no_contents);
       return FALSE;
index 4d532b2cd21cfc99731cf8e6860cb2d0861e6028..9a2754ebe69e674c4c958b95f2251e1dc2dcf727 100644 (file)
@@ -1290,7 +1290,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
 
   /* We are passed a section relative offset.  The offsets in the
      stabs information are absolute.  */
-  offset += bfd_get_section_vma (abfd, section);
+  offset += bfd_section_vma (section);
 
 #ifdef ENABLE_CACHING
   if (info->cached_indexentry != NULL
index 8d2a2dff623a15ea9756e8e9e39a03a77d76d405..4dde056e1ee67e638a3af4beda2a08897f0e557b 100644 (file)
@@ -632,7 +632,7 @@ _bfd_vms_slurp_eisd (bfd *abfd, unsigned int offset)
       section->size = size;
       section->vma = vaddr;
 
-      if (!bfd_set_section_flags (abfd, section, bfd_flags))
+      if (!bfd_set_section_flags (section, bfd_flags))
        return FALSE;
     }
 
@@ -687,7 +687,7 @@ _bfd_vms_slurp_eihs (bfd *abfd, unsigned int offset)
       section->size = dstsize;
       section->filepos = VMS_BLOCK_SIZE * (dstvbn - 1);
 
-      if (!bfd_set_section_flags (abfd, section, bfd_flags))
+      if (!bfd_set_section_flags (section, bfd_flags))
        return FALSE;
 
       PRIV (dst_section) = section;
@@ -705,7 +705,7 @@ _bfd_vms_slurp_eihs (bfd *abfd, unsigned int offset)
       section->size = dmtbytes;
       section->filepos = VMS_BLOCK_SIZE * (dmtvbn - 1);
 
-      if (!bfd_set_section_flags (abfd, section, bfd_flags))
+      if (!bfd_set_section_flags (section, bfd_flags))
        return FALSE;
     }
 
@@ -1261,7 +1261,7 @@ _bfd_vms_slurp_egsd (bfd *abfd)
                    new_flags |= SEC_CODE;
                    new_flags &= ~SEC_DATA;
                  }
-               if (!bfd_set_section_flags (abfd, section, new_flags))
+               if (!bfd_set_section_flags (section, new_flags))
                  return FALSE;
 
                /* Give a non-overlapping vma to non absolute sections.  */
@@ -2441,7 +2441,7 @@ vms_slurp_debug (bfd *abfd)
       section = bfd_make_section (abfd, "$DST$");
       if (!section)
        return FALSE;
-      if (!bfd_set_section_flags (abfd, section, flags))
+      if (!bfd_set_section_flags (section, flags))
        return FALSE;
       PRIV (dst_section) = section;
     }
@@ -4623,7 +4623,7 @@ build_module_list (bfd *abfd)
         section and build the list of modules.  This is sufficient
         since we can compute the start address and the end address
         of every module from the section contents.  */
-      bfd_size_type size = bfd_get_section_size (dmt);
+      bfd_size_type size = bfd_section_size (dmt);
       unsigned char *ptr, *end;
 
       ptr = (unsigned char *) bfd_alloc (abfd, size);
@@ -9324,7 +9324,7 @@ vms_new_section_hook (bfd * abfd, asection *section)
   vms_debug2 ((1, "vms_new_section_hook (%p, [%u]%s)\n",
               abfd, section->index, section->name));
 
-  if (! bfd_set_section_alignment (abfd, section, 0))
+  if (!bfd_set_section_alignment (section, 0))
     return FALSE;
 
   vms_debug2 ((7, "%u: %s\n", section->index, section->name));
@@ -9412,11 +9412,11 @@ vms_get_symbol_info (bfd * abfd ATTRIBUTE_UNUSED,
   else if (bfd_is_ind_section (sec))
     ret->type = 'I';
   else if ((symbol->flags & BSF_FUNCTION)
-          || (bfd_get_section_flags (abfd, sec) & SEC_CODE))
+          || (bfd_section_flags (sec) & SEC_CODE))
     ret->type = 'T';
-  else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
+  else if (bfd_section_flags (sec) & SEC_DATA)
     ret->type = 'D';
-  else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+  else if (bfd_section_flags (sec) & SEC_ALLOC)
     ret->type = 'B';
   else
     ret->type = '?';
index 1a2f87c4b0084cc3ade3539d8add2b6f23638e1d..52691720aeaa0bb207f8982e06319d9829bda4f0 100644 (file)
@@ -2080,14 +2080,14 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
   for (o = abfd->sections; o != first_csect; o = o->next)
     {
       /* Debugging sections have no csects.  */
-      if (bfd_get_section_flags (abfd, o) & SEC_DEBUGGING)
+      if (bfd_section_flags (o) & SEC_DEBUGGING)
        continue;
 
       /* Reset the section size and the line number count, since the
         data is now attached to the csects.  Don't reset the size of
         the .debug section, since we need to read it below in
         bfd_xcoff_size_dynamic_sections.  */
-      if (strcmp (bfd_get_section_name (abfd, o), ".debug") != 0)
+      if (strcmp (bfd_section_name (o), ".debug") != 0)
        o->size = 0;
       o->lineno_count = 0;
 
@@ -3019,7 +3019,7 @@ xcoff_sweep (struct bfd_link_info *info)
                  || o == xcoff_hash_table (info)->loader_section
                  || o == xcoff_hash_table (info)->linkage_section
                  || o == xcoff_hash_table (info)->descriptor_section
-                 || (bfd_get_section_flags (sub, o) & SEC_DEBUGGING)
+                 || (bfd_section_flags (o) & SEC_DEBUGGING)
                  || strcmp (o->name, ".debug") == 0)
                o->flags |= SEC_MARK;
              else
index 9c791f6d6565ca7321e40c45f54d6f43eff4ec59..9f6300f17d6c105cabfcc01505f248ce17d50be1 100644 (file)
@@ -1,3 +1,11 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2019-09-18  Alan Modra  <amodra@gmail.com>
 
        * nm.c: Update bfd_get_section to bfd_asymbol_section throughout.
index 8a77c473badc9950bff4c363a3415589d61c222d..d9cc2881f8db8e392ceed19fcfceb679c5940c26 100644 (file)
@@ -182,14 +182,14 @@ find_address_in_section (bfd *abfd, asection *section,
   if (found)
     return;
 
-  if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+  if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
     return;
 
-  vma = bfd_get_section_vma (abfd, section);
+  vma = bfd_section_vma (section);
   if (pc < vma)
     return;
 
-  size = bfd_get_section_size (section);
+  size = bfd_section_size (section);
   if (pc >= vma + size)
     return;
 
@@ -208,10 +208,10 @@ find_offset_in_section (bfd *abfd, asection *section)
   if (found)
     return;
 
-  if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+  if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
     return;
 
-  size = bfd_get_section_size (section);
+  size = bfd_section_size (section);
   if (pc >= size)
     return;
 
index e8ac3b6de85e0d50fbf1ca4272c85bddb2500f1c..2493fd561bc71e7edc106b715aa16ff1a7ec41ba 100644 (file)
@@ -94,7 +94,7 @@ bfd_nonfatal_message (const char *filename,
       if (!filename)
        filename = bfd_get_archive_filename (abfd);
       if (section)
-       section_name = bfd_get_section_name (abfd, section);
+       section_name = bfd_section_name (section);
     }
   if (section_name)
     fprintf (stderr, ":%s[%s]", filename, section_name);
index 1556a0b8ad25764c532bc8c5625dc3eb8355fd87..177c66ed7664d56981cfe7d2ee5721df1be5ca49 100644 (file)
@@ -145,7 +145,7 @@ do_sections_p1 (struct coff_ofile *head)
       if (strcmp (section->name, ".bss") == 0)
        head->sections[i].data = 1;
       head->sections[i].address = section->lma;
-      head->sections[i].size = bfd_get_section_size (section);
+      head->sections[i].size = bfd_section_size (section);
       head->sections[i].number = idx;
       head->sections[i].nrelocs = section->reloc_count;
       head->sections[i].relocs =
index cd2ff24325d94851b1b04289067dde4a214f085c..85304d0c37fcf064ecffe28d451d3ea48e72ce3b 100644 (file)
@@ -1384,7 +1384,7 @@ scan_drectve_symbols (bfd *abfd)
   if (s == NULL)
     return;
 
-  size = bfd_get_section_size (s);
+  size = bfd_section_size (s);
   buf  = xmalloc (size);
 
   bfd_get_section_contents (abfd, s, buf, 0, size);
@@ -2482,11 +2482,9 @@ make_one_lib_file (export_type *exp, int i, int delay)
       if (si->id != i)
        abort ();
       si->sec = bfd_make_section_old_way (abfd, si->name);
-      bfd_set_section_flags (abfd,
-                            si->sec,
-                            si->flags & applicable);
+      bfd_set_section_flags (si->sec, si->flags & applicable);
 
-      bfd_set_section_alignment(abfd, si->sec, si->align);
+      bfd_set_section_alignment (si->sec, si->align);
       si->sec->output_section = si->sec;
       si->sym = bfd_make_empty_symbol(abfd);
       si->sym->name = si->sec->name;
@@ -2822,7 +2820,7 @@ make_one_lib_file (export_type *exp, int i, int delay)
            arelent *imglue, *ba_rel, *ea_rel, *pea_rel;
 
            /* Alignment must be set to 2**2 or you get extra stuff.  */
-           bfd_set_section_alignment(abfd, sec, 2);
+           bfd_set_section_alignment (sec, 2);
 
            si->size = 4 * 5;
            si->data = xmalloc (si->size);
@@ -2908,8 +2906,8 @@ make_one_lib_file (export_type *exp, int i, int delay)
       {
        sinfo *si = secdata + i;
 
-       bfd_set_section_size (abfd, si->sec, si->size);
-       bfd_set_section_vma (abfd, si->sec, vma);
+       bfd_set_section_size (si->sec, si->size);
+       bfd_set_section_vma (si->sec, vma);
       }
   }
   /* Write them out.  */
@@ -3691,7 +3689,7 @@ identify_search_section (bfd * abfd, asection * section, void * obj)
   if (ms_style && ((section->flags & SEC_DATA) == 0))
     return;
 
-  if ((datasize = bfd_section_size (abfd, section)) == 0)
+  if ((datasize = bfd_section_size (section)) == 0)
     return;
 
   data = (bfd_byte *) xmalloc (datasize + 1);
index 0bded073912680c0965409b43316c320b717061d..e177d444efde547f4efa0b22a05d0014ca0700fb 100644 (file)
@@ -791,8 +791,8 @@ sort_symbols_by_size (bfd *abfd, bfd_boolean is_dynamic, void *minisyms,
              && sec == bfd_asymbol_section (next))
            sz = valueof (next) - valueof (sym);
          else
-           sz = (bfd_get_section_vma (abfd, sec)
-                 + bfd_section_size (abfd, sec)
+           sz = (bfd_section_vma (sec)
+                 + bfd_section_size (sec)
                  - valueof (sym));
        }
 
index ce4a4afa55c6fb49d9530319c00b4821fa5affc9..6489fbe72f90c85787096bd4d39cb67ab8f58381 100644 (file)
@@ -1255,7 +1255,7 @@ group_signature (asection *group)
 static bfd_boolean
 is_dwo_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
 {
-  const char *name = bfd_get_section_name (abfd, sec);
+  const char *name = bfd_section_name (sec);
   int len = strlen (name);
 
   return strncmp (name + len - 4, ".dwo", 4) == 0;
@@ -1310,17 +1310,17 @@ is_strip_section_1 (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
       struct section_list *p;
       struct section_list *q;
 
-      p = find_section_list (bfd_get_section_name (abfd, sec), FALSE,
+      p = find_section_list (bfd_section_name (sec), FALSE,
                             SECTION_CONTEXT_REMOVE);
-      q = find_section_list (bfd_get_section_name (abfd, sec), FALSE,
+      q = find_section_list (bfd_section_name (sec), FALSE,
                             SECTION_CONTEXT_COPY);
 
       if (p && q)
        fatal (_("error: section %s matches both remove and copy options"),
-              bfd_get_section_name (abfd, sec));
+              bfd_section_name (sec));
       if (p && is_update_section (abfd, sec))
        fatal (_("error: section %s matches both update and remove options"),
-              bfd_get_section_name (abfd, sec));
+              bfd_section_name (sec));
 
       if (p != NULL)
        return TRUE;
@@ -1328,7 +1328,7 @@ is_strip_section_1 (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
        return TRUE;
     }
 
-  if ((bfd_get_section_flags (abfd, sec) & SEC_DEBUGGING) != 0)
+  if ((bfd_section_flags (sec) & SEC_DEBUGGING) != 0)
     {
       if (strip_symbols == STRIP_DEBUG
          || strip_symbols == STRIP_UNNEEDED
@@ -1339,7 +1339,7 @@ is_strip_section_1 (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
          /* By default we don't want to strip .reloc section.
             This section has for pe-coff special meaning.   See
             pe-dll.c file in ld, and peXXigen.c in bfd for details.  */
-         if (strcmp (bfd_get_section_name (abfd, sec), ".reloc") != 0)
+         if (strcmp (bfd_section_name (sec), ".reloc") != 0)
            return TRUE;
        }
 
@@ -1364,7 +1364,7 @@ is_strip_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
   if (is_strip_section_1 (abfd, sec))
     return TRUE;
 
-  if ((bfd_get_section_flags (abfd, sec) & SEC_GROUP) != 0)
+  if ((bfd_section_flags (sec) & SEC_GROUP) != 0)
     {
       asymbol *gsym;
       const char *gname;
@@ -1414,7 +1414,7 @@ is_nondebug_keep_contents_section (bfd *ibfd, asection *isection)
      directory", but that may be the .text section for objects produced by some
      tools, which it is not sensible to keep.  */
   if (ibfd->xvec->flavour == bfd_target_coff_flavour)
-    return (strcmp (bfd_get_section_name (ibfd, isection), ".buildid") == 0);
+    return (strcmp (bfd_section_name (isection), ".buildid") == 0);
 
   return FALSE;
 }
@@ -2728,7 +2728,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
                }
            }
 
-         if (! bfd_set_section_size (obfd, padd->section, padd->size))
+         if (!bfd_set_section_size (padd->section, padd->size))
            {
              bfd_nonfatal_message (NULL, obfd, padd->section, NULL);
              return FALSE;
@@ -2737,7 +2737,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
          pset = find_section_list (padd->name, FALSE,
                                    SECTION_CONTEXT_SET_VMA | SECTION_CONTEXT_ALTER_VMA);
          if (pset != NULL
-             && ! bfd_set_section_vma (obfd, padd->section, pset->vma_val))
+             && !bfd_set_section_vma (padd->section, pset->vma_val))
            {
              bfd_nonfatal_message (NULL, obfd, padd->section, NULL);
              return FALSE;
@@ -2749,9 +2749,8 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
            {
              padd->section->lma = pset->lma_val;
 
-             if (! bfd_set_section_alignment
-                 (obfd, padd->section,
-                  bfd_section_alignment (obfd, padd->section)))
+             if (!bfd_set_section_alignment
+                 (padd->section, bfd_section_alignment (padd->section)))
                {
                  bfd_nonfatal_message (NULL, obfd, padd->section, NULL);
                  return FALSE;
@@ -2776,7 +2775,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
            }
 
          osec = pupdate->section->output_section;
-         if (! bfd_set_section_size (obfd, osec, pupdate->size))
+         if (!bfd_set_section_size (osec, pupdate->size))
            {
              bfd_nonfatal_message (NULL, obfd, osec, NULL);
              return FALSE;
@@ -2793,7 +2792,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
        {
          bfd_size_type size;
          
-         size = bfd_get_section_size (osec);
+         size = bfd_section_size (osec);
          if (size == 0)
            {
              bfd_nonfatal_message (NULL, ibfd, osec, _("warning: note section is empty"));
@@ -2820,7 +2819,8 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
              else
                {
                  if (osec->output_section == NULL
-                     || ! bfd_set_section_size (obfd, osec->output_section, merged_size))
+                     || !bfd_set_section_size (osec->output_section,
+                                               merged_size))
                    {
                      bfd_nonfatal_message (NULL, obfd, osec, _("warning: failed to set merged notes size"));
                      free (merged_notes);
@@ -2848,14 +2848,14 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
              continue;
            }
 
-         if ((bfd_get_section_flags (ibfd, osec) & SEC_HAS_CONTENTS) == 0)
+         if ((bfd_section_flags (osec) & SEC_HAS_CONTENTS) == 0)
            {
              bfd_nonfatal_message (NULL, ibfd, osec,
                                    _("can't dump section - it has no contents"));
              continue;
            }
 
-         bfd_size_type size = bfd_get_section_size (osec);
+         bfd_size_type size = bfd_section_size (osec);
          if (size == 0)
            {
              bfd_nonfatal_message (NULL, ibfd, osec,
@@ -2948,7 +2948,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
                                           + highest_section->size,
                                           /* FIXME: We ought to be using
                                              COFF_PAGE_SIZE here or maybe
-                                             bfd_get_section_alignment() (if it
+                                             bfd_section_alignment() (if it
                                              was set) but since this is for PE
                                              and we know the required alignment
                                              it is easier just to hard code it.  */
@@ -2957,7 +2957,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
                /* Umm, not sure what to do in this case.  */
                debuglink_vma = 0x1000;
 
-             bfd_set_section_vma (obfd, gnu_debuglink_section, debuglink_vma);
+             bfd_set_section_vma (gnu_debuglink_section, debuglink_vma);
            }
        }
     }
@@ -2991,18 +2991,18 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
              bfd_size_type size;
              bfd_vma gap_start, gap_stop;
 
-             flags = bfd_get_section_flags (obfd, osections[i]);
+             flags = bfd_section_flags (osections[i]);
              if ((flags & SEC_HAS_CONTENTS) == 0
                  || (flags & SEC_LOAD) == 0)
                continue;
 
-             size = bfd_section_size (obfd, osections[i]);
-             gap_start = bfd_section_lma (obfd, osections[i]) + size;
-             gap_stop = bfd_section_lma (obfd, osections[i + 1]);
+             size = bfd_section_size (osections[i]);
+             gap_start = bfd_section_lma (osections[i]) + size;
+             gap_stop = bfd_section_lma (osections[i + 1]);
              if (gap_start < gap_stop)
                {
-                 if (! bfd_set_section_size (obfd, osections[i],
-                                             size + (gap_stop - gap_start)))
+                 if (!bfd_set_section_size (osections[i],
+                                            size + (gap_stop - gap_start)))
                    {
                      bfd_nonfatal_message (NULL, obfd, osections[i],
                                            _("Can't fill gap after section"));
@@ -3021,12 +3021,11 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
          bfd_vma lma;
          bfd_size_type size;
 
-         lma = bfd_section_lma (obfd, osections[c - 1]);
-         size = bfd_section_size (obfd, osections[c - 1]);
+         lma = bfd_section_lma (osections[c - 1]);
+         size = bfd_section_size (osections[c - 1]);
          if (lma + size < pad_to)
            {
-             if (! bfd_set_section_size (obfd, osections[c - 1],
-                                         pad_to - lma))
+             if (!bfd_set_section_size (osections[c - 1], pad_to - lma))
                {
                  bfd_nonfatal_message (NULL, obfd, osections[c - 1],
                                        _("can't add padding"));
@@ -3204,7 +3203,7 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
              file_ptr off;
 
              left = gaps[i];
-             off = bfd_section_size (obfd, osections[i]) - left;
+             off = bfd_section_size (osections[i]) - left;
 
              while (left > 0)
                {
@@ -3779,13 +3778,13 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
     return;
 
   /* Get the, possibly new, name of the output section.  */
-  name = bfd_section_name (ibfd, isection);
-  flags = bfd_get_section_flags (ibfd, isection);
+  name = bfd_section_name (isection);
+  flags = bfd_section_flags (isection);
   name = find_section_rename (name, &flags);
 
   /* Prefix sections.  */
   if ((prefix_alloc_sections_string)
-      && (bfd_get_section_flags (ibfd, isection) & SEC_ALLOC))
+      && (bfd_section_flags (isection) & SEC_ALLOC))
     prefix = prefix_alloc_sections_string;
   else if (prefix_sections_string)
     prefix = prefix_sections_string;
@@ -3802,7 +3801,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
 
   make_nobits = FALSE;
 
-  p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+  p = find_section_list (bfd_section_name (isection), FALSE,
                         SECTION_CONTEXT_SET_FLAGS);
   if (p != NULL)
     flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC));
@@ -3834,20 +3833,20 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
   if (make_nobits)
     elf_section_type (osection) = SHT_NOBITS;
 
-  size = bfd_section_size (ibfd, isection);
+  size = bfd_section_size (isection);
   size = bfd_convert_section_size (ibfd, isection, obfd, size);
   if (copy_byte >= 0)
     size = (size + interleave - 1) / interleave * copy_width;
   else if (extract_symbol)
     size = 0;
-  if (! bfd_set_section_size (obfd, osection, size))
+  if (!bfd_set_section_size (osection, size))
     {
       err = _("failed to set size");
       goto loser;
     }
 
-  vma = bfd_section_vma (ibfd, isection);
-  p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+  vma = bfd_section_vma (isection);
+  p = find_section_list (bfd_section_name (isection), FALSE,
                         SECTION_CONTEXT_ALTER_VMA | SECTION_CONTEXT_SET_VMA);
   if (p != NULL)
     {
@@ -3859,14 +3858,14 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
   else
     vma += change_section_address;
 
-  if (! bfd_set_section_vma (obfd, osection, vma))
+  if (!bfd_set_section_vma (osection, vma))
     {
       err = _("failed to set vma");
       goto loser;
     }
 
   lma = isection->lma;
-  p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+  p = find_section_list (bfd_section_name (isection), FALSE,
                         SECTION_CONTEXT_ALTER_LMA | SECTION_CONTEXT_SET_LMA);
   if (p != NULL)
     {
@@ -3880,18 +3879,16 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
 
   osection->lma = lma;
 
-  p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+  p = find_section_list (bfd_section_name (isection), FALSE,
                         SECTION_CONTEXT_SET_ALIGNMENT);
   if (p != NULL)
     alignment = p->alignment;
   else
-    alignment = bfd_section_alignment (ibfd, isection);
+    alignment = bfd_section_alignment (isection);
   
   /* FIXME: This is probably not enough.  If we change the LMA we
      may have to recompute the header for the file as well.  */
-  if (!bfd_set_section_alignment (obfd,
-                                 osection,
-                                 alignment))
+  if (!bfd_set_section_alignment (osection, alignment))
     {
       err = _("failed to set alignment");
       goto loser;
@@ -3965,12 +3962,12 @@ skip_section (bfd *ibfd, sec_ptr isection, bfd_boolean skip_copy)
   if (skip_copy && is_merged_note_section (ibfd, isection))
     return TRUE;
 
-  flags = bfd_get_section_flags (ibfd, isection);
+  flags = bfd_section_flags (isection);
   if ((flags & SEC_GROUP) != 0)
     return TRUE;
 
   osection = isection->output_section;
-  size = bfd_get_section_size (isection);
+  size = bfd_section_size (isection);
 
   if (size == 0 || osection == 0)
     return TRUE;
@@ -3995,7 +3992,7 @@ handle_remove_relocations_option (const char *section_pattern)
 static bfd_boolean
 discard_relocations (bfd *ibfd ATTRIBUTE_UNUSED, asection *isection)
 {
-  return (find_section_list (bfd_section_name (ibfd, isection), FALSE,
+  return (find_section_list (bfd_section_name (isection), FALSE,
                             SECTION_CONTEXT_REMOVE_RELOCS) != NULL);
 }
 
@@ -4140,10 +4137,10 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
      ELF classes of input and output aren't the same.  We can't use
      the output section size since --interleave will shrink the output
      section.   Size will be updated if the section is converted.   */
-  size = bfd_get_section_size (isection);
+  size = bfd_section_size (isection);
 
-  if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS
-      && bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS)
+  if (bfd_section_flags (isection) & SEC_HAS_CONTENTS
+      && bfd_section_flags (osection) & SEC_HAS_CONTENTS)
     {
       bfd_byte *memhunk = NULL;
 
@@ -4180,7 +4177,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
          else
            /* User must pad the section up in order to do this.  */
            fatal (_("cannot reverse bytes: length of section %s must be evenly divisible by %d"),
-                  bfd_section_name (ibfd, isection), reverse_bytes);
+                  bfd_section_name (isection), reverse_bytes);
        }
 
       if (copy_byte >= 0)
@@ -4223,7 +4220,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
        }
       free (memhunk);
     }
-  else if ((p = find_section_list (bfd_get_section_name (ibfd, isection),
+  else if ((p = find_section_list (bfd_section_name (isection),
                                   FALSE, SECTION_CONTEXT_SET_FLAGS)) != NULL
           && (p->flags & SEC_HAS_CONTENTS) != 0)
     {
@@ -4294,9 +4291,9 @@ compare_section_lma (const void *arg1, const void *arg2)
     return -1;
 
   /* Sort sections with the same LMA by size.  */
-  if (bfd_get_section_size (*sec1) > bfd_get_section_size (*sec2))
+  if (bfd_section_size (*sec1) > bfd_section_size (*sec2))
     return 1;
-  else if (bfd_get_section_size (*sec1) < bfd_get_section_size (*sec2))
+  else if (bfd_section_size (*sec1) < bfd_section_size (*sec2))
     return -1;
 
   return 0;
@@ -4378,10 +4375,10 @@ write_debugging_info (bfd *obfd, void *dhandle,
       stabstrsec = bfd_make_section_with_flags (obfd, ".stabstr", flags);
       if (stabsec == NULL
          || stabstrsec == NULL
-         || ! bfd_set_section_size (obfd, stabsec, symsize)
-         || ! bfd_set_section_size (obfd, stabstrsec, stringsize)
-         || ! bfd_set_section_alignment (obfd, stabsec, 2)
-         || ! bfd_set_section_alignment (obfd, stabstrsec, 0))
+         || !bfd_set_section_size (stabsec, symsize)
+         || !bfd_set_section_size (stabstrsec, stringsize)
+         || !bfd_set_section_alignment (stabsec, 2)
+         || !bfd_set_section_alignment (stabstrsec, 0))
        {
          bfd_nonfatal_message (NULL, obfd, NULL,
                                _("can't create debugging section"));
index 4a7c8f9a74bf0518bfcb5e5c72a2c53e8bb4eeb5..96727a0f51e0ce04d35f7b7419424e0e551f30e3 100644 (file)
@@ -545,13 +545,13 @@ dump_section_header (bfd *abfd, asection *section, void *data)
     return;
 
   printf ("%3d %-*s %08lx  ", section->index, longest_section_name,
-         sanitize_string (bfd_get_section_name (abfd, section)),
-         (unsigned long) bfd_section_size (abfd, section) / opb);
-  bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section));
+         sanitize_string (bfd_section_name (section)),
+         (unsigned long) bfd_section_size (section) / opb);
+  bfd_printf_vma (abfd, bfd_section_vma (section));
   printf ("  ");
   bfd_printf_vma (abfd, section->lma);
   printf ("  %08lx  2**%u", (unsigned long) section->filepos,
-         bfd_get_section_alignment (abfd, section));
+         bfd_section_alignment (section));
   if (! wide_output)
     printf ("\n                ");
   printf ("  ");
@@ -631,7 +631,8 @@ dump_section_header (bfd *abfd, asection *section, void *data)
    DATA which contains the string length of the longest section name.  */
 
 static void
-find_longest_section_name (bfd *abfd, asection *section, void *data)
+find_longest_section_name (bfd *abfd ATTRIBUTE_UNUSED,
+                          asection *section, void *data)
 {
   int *longest_so_far = (int *) data;
   const char *name;
@@ -645,7 +646,7 @@ find_longest_section_name (bfd *abfd, asection *section, void *data)
   if (! process_section_p (section))
     return;
 
-  name = bfd_get_section_name (abfd, section);
+  name = bfd_section_name (section);
   len = (int) strlen (name);
   if (len > *longest_so_far)
     *longest_so_far = len;
@@ -1034,8 +1035,8 @@ sym_ok (bfd_boolean               want_section,
         debug info file, whilst the section we want is in a normal file.
         So the section pointers will be different, but the section names
         will be the same.  */
-      if (strcmp (bfd_section_name (abfd, sorted_syms[place]->section),
-                 bfd_section_name (abfd, sec)) != 0)
+      if (strcmp (bfd_section_name (sorted_syms[place]->section),
+                 bfd_section_name (sec)) != 0)
        return FALSE;
     }
 
@@ -1141,9 +1142,9 @@ find_symbol_for_address (bfd_vma vma,
      Also give the target a chance to reject symbols.  */
   want_section = (aux->require_sec
                  || ((abfd->flags & HAS_RELOC) != 0
-                     && vma >= bfd_get_section_vma (abfd, sec)
-                     && vma < (bfd_get_section_vma (abfd, sec)
-                               + bfd_section_size (abfd, sec) / opb)));
+                     && vma >= bfd_section_vma (sec)
+                     && vma < (bfd_section_vma (sec)
+                               + bfd_section_size (sec) / opb)));
   
   if (! sym_ok (want_section, abfd, thisplace, sec, inf))
     {
@@ -1267,8 +1268,8 @@ objdump_print_addr_with_sym (bfd *abfd, asection *sec, asymbol *sym,
       bfd_vma secaddr;
 
       (*inf->fprintf_func) (inf->stream, " <%s",
-                           sanitize_string (bfd_get_section_name (abfd, sec)));
-      secaddr = bfd_get_section_vma (abfd, sec);
+                           sanitize_string (bfd_section_name (sec)));
+      secaddr = bfd_section_vma (sec);
       if (vma < secaddr)
        {
          (*inf->fprintf_func) (inf->stream, "-0x");
@@ -2235,7 +2236,7 @@ disassemble_bytes (struct disassemble_info * inf,
                      asection *sym_sec;
 
                      sym_sec = bfd_asymbol_section (*q->sym_ptr_ptr);
-                     sym_name = bfd_get_section_name (aux->abfd, sym_sec);
+                     sym_name = bfd_section_name (sym_sec);
                      if (sym_name == NULL || *sym_name == '\0')
                        sym_name = "*unknown*";
                      printf ("%s", sanitize_string (sym_name));
@@ -2308,7 +2309,7 @@ disassemble_section (bfd *abfd, asection *section, void *inf)
   if (! process_section_p (section))
     return;
 
-  datasize = bfd_get_section_size (section);
+  datasize = bfd_section_size (section);
   if (datasize == 0)
     return;
 
@@ -2538,7 +2539,7 @@ disassemble_section (bfd *abfd, asection *section, void *inf)
       else
        {
 #define is_valid_next_sym(SYM) \
-  (strcmp (bfd_section_name (abfd, (SYM)->section), bfd_section_name (abfd, section)) == 0 \
+  (strcmp (bfd_section_name ((SYM)->section), bfd_section_name (section)) == 0 \
    && (bfd_asymbol_value (SYM) > bfd_asymbol_value (sym)) \
    && pinfo->symbol_is_valid (SYM, pinfo))
 
@@ -2750,9 +2751,9 @@ load_specific_debug_section (enum dwarf_section_display_enum debug,
   section->filename = bfd_get_filename (abfd);
   section->reloc_info = NULL;
   section->num_relocs = 0;
-  section->address = bfd_get_section_vma (abfd, sec);
+  section->address = bfd_section_vma (sec);
   section->user_data = sec;
-  section->size = bfd_get_section_size (sec);
+  section->size = bfd_section_size (sec);
   /* PR 24360: On 32-bit hosts sizeof (size_t) < sizeof (bfd_size_type). */
   alloced = amt = section->size + 1;
   if (alloced != amt || alloced == 0)
@@ -2925,7 +2926,7 @@ static void
 dump_dwarf_section (bfd *abfd, asection *section,
                    void *arg ATTRIBUTE_UNUSED)
 {
-  const char *name = bfd_get_section_name (abfd, section);
+  const char *name = bfd_section_name (section);
   const char *match;
   int i;
 
@@ -3050,7 +3051,7 @@ read_section_stabs (bfd *abfd, const char *sect_name, bfd_size_type *size_ptr,
       return NULL;
     }
 
-  *size_ptr = bfd_section_size (abfd, stabsect);
+  *size_ptr = bfd_section_size (stabsect);
   if (entsize_ptr)
     *entsize_ptr = stabsect->entsize;
 
@@ -3459,7 +3460,7 @@ dump_section (bfd *abfd, asection *section, void *dummy ATTRIBUTE_UNUSED)
   if (! process_section_p (section))
     return;
 
-  if ((datasize = bfd_section_size (abfd, section)) == 0)
+  if ((datasize = bfd_section_size (section)) == 0)
     return;
 
   /* Compute the address range to display.  */
index aaa97bb5818e6c3cc56144241ef69a7aeadd0101..4a607d20ee7f981aa50256417f8bdd80debda76a 100644 (file)
@@ -85,7 +85,7 @@ elf32_avr_get_note_section_contents (bfd *abfd, bfd_size_type *size)
   if ((section = bfd_get_section_by_name (abfd, ".note.gnu.avr.deviceinfo")) == NULL)
     return NULL;
 
-  *size = bfd_get_section_size (section);
+  *size = bfd_section_size (section);
   char *contents = (char *) xmalloc (*size);
   bfd_get_section_contents (abfd, section, contents, 0, *size);
 
@@ -162,17 +162,17 @@ elf32_avr_get_memory_usage (bfd *abfd,
   asection *section;
 
   if ((section = bfd_get_section_by_name (abfd, ".data")) != NULL)
-    avr_datasize = bfd_section_size (abfd, section);
+    avr_datasize = bfd_section_size (section);
   if ((section = bfd_get_section_by_name (abfd, ".text")) != NULL)
-    avr_textsize = bfd_section_size (abfd, section);
+    avr_textsize = bfd_section_size (section);
   if ((section = bfd_get_section_by_name (abfd, ".bss")) != NULL)
-    avr_bsssize = bfd_section_size (abfd, section);
+    avr_bsssize = bfd_section_size (section);
   if ((section = bfd_get_section_by_name (abfd, ".bootloader")) != NULL)
-    bootloadersize = bfd_section_size (abfd, section);
+    bootloadersize = bfd_section_size (section);
   if ((section = bfd_get_section_by_name (abfd, ".noinit")) != NULL)
-    noinitsize = bfd_section_size (abfd, section);
+    noinitsize = bfd_section_size (section);
   if ((section = bfd_get_section_by_name (abfd, ".eeprom")) != NULL)
-    eepromsize = bfd_section_size (abfd, section);
+    eepromsize = bfd_section_size (section);
 
   *text_usage = avr_textsize + avr_datasize + bootloadersize;
   *data_usage = avr_datasize + avr_bsssize + noinitsize;
@@ -255,12 +255,12 @@ elf32_avr_dump_avr_prop (bfd *abfd)
   for (i = 0; i < r_list->record_count; ++i)
     {
       printf ("   %d %s @ %s + %#08lx (%#08lx)\n",
-              i,
-              avr_elf32_property_record_name (&r_list->records [i]),
-              r_list->records [i].section->name,
-              r_list->records [i].offset,
-              (bfd_get_section_vma (abfd, r_list->records [i].section)
-               + r_list->records [i].offset));
+             i,
+             avr_elf32_property_record_name (&r_list->records [i]),
+             r_list->records [i].section->name,
+             r_list->records [i].offset,
+             (bfd_section_vma (r_list->records [i].section)
+              + r_list->records [i].offset));
       switch (r_list->records [i].type)
         {
         case RECORD_ORG:
index 6dc8c4d385e12f907236dca903ad51a32d71dd44..ada86b52360e2288cea789049d76a6cb43736d76 100644 (file)
@@ -2259,7 +2259,7 @@ dump_section_content (bfd *abfd,
                asection *bfdsec = sec->bfdsection;
                unsigned char *content;
 
-               size = bfd_get_section_size (bfdsec);
+               size = bfd_section_size (bfdsec);
                content = (unsigned char *) xmalloc (size);
                bfd_get_section_contents (abfd, bfdsec, content, 0, size);
 
index 1f79985002d191041b906b7a3a1f590ee558b988..e5566bc9a73c7a97b790d4c646391ec862e1e295 100644 (file)
@@ -763,7 +763,7 @@ dump_xcoff32_symbols (bfd *abfd, struct xcoff_dump *data)
     {
       bfd_size_type size;
 
-      size = bfd_get_section_size (debugsec);
+      size = bfd_section_size (debugsec);
       debug = (char *) xmalloc (size);
       bfd_get_section_contents (abfd, debugsec, debug, 0, size);
     }
@@ -1051,7 +1051,7 @@ dump_xcoff32_loader (bfd *abfd)
       printf (_("no .loader section in file\n"));
       return;
     }
-  size = bfd_get_section_size (loader);
+  size = bfd_section_size (loader);
   if (size < sizeof (*lhdr))
     {
       printf (_("section .loader is too short\n"));
@@ -1198,7 +1198,7 @@ dump_xcoff32_except (bfd *abfd, struct xcoff_dump *data)
       printf (_("no .except section in file\n"));
       return;
     }
-  size = bfd_get_section_size (sec);
+  size = bfd_section_size (sec);
   excp_data = (bfd_byte *) xmalloc (size);
   bfd_get_section_contents (abfd, sec, excp_data, 0, size);
   exceptab = (struct external_exceptab *)excp_data;
@@ -1241,7 +1241,7 @@ dump_xcoff32_typchk (bfd *abfd)
       printf (_("no .typchk section in file\n"));
       return;
     }
-  size = bfd_get_section_size (sec);
+  size = bfd_section_size (sec);
   data = (bfd_byte *) xmalloc (size);
   bfd_get_section_contents (abfd, sec, data, 0, size);
 
@@ -1449,9 +1449,9 @@ dump_xcoff32_traceback (bfd *abfd, struct xcoff_dump *data)
   text_sec = bfd_get_section_by_name (abfd, ".text");
   if (text_sec == NULL)
     return;
-  text_vma = bfd_get_section_vma (abfd, text_sec);
+  text_vma = bfd_section_vma (text_sec);
 
-  text_size = bfd_get_section_size (text_sec);
+  text_size = bfd_section_size (text_sec);
   text = (char *) xmalloc (text_size);
   bfd_get_section_contents (abfd, text_sec, text, 0, text_size);
 
index d44f5c4fccd63e2f5555fb68918a93fd04d6e44f..40cf54b8fe948eae493a06fba3188c9a07fed310 100644 (file)
@@ -1930,14 +1930,14 @@ find_address_in_section (bfd *abfd, asection *section, void *data)
   if (found)
     return;
 
-  if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+  if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
     return;
 
-  vma = bfd_get_section_vma (abfd, section);
+  vma = bfd_section_vma (section);
   if (pc < vma)
     return;
 
-  size = bfd_get_section_size (section);
+  size = bfd_section_size (section);
   if (pc >= vma + size)
     return;
 
index cbb5db1b94bf6f83883856a78aeba0bfa56d08b8..006f13b3aa015d96e2c25c89145bfe6313b806f1 100644 (file)
@@ -816,7 +816,7 @@ parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle)
                  else
                    base = auxent.x_sym.x_misc.x_lnsz.x_lnno - 1;
 
-                 addr = bfd_get_section_vma (abfd, bfd_asymbol_section (sym));
+                 addr = bfd_section_vma (bfd_asymbol_section (sym));
 
                  ++linenos;
 
index 92052783ba919c5e3156bbf34fad9bb5e787afd1..eb8ffcbc0257c4cad7e87adcbbf9c0ced1cba621 100644 (file)
@@ -121,7 +121,7 @@ read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
          bfd_byte *stab;
          bfd_size_type stroff, next_stroff;
 
-         stabsize = bfd_section_size (abfd, sec);
+         stabsize = bfd_section_size (sec);
          stabs = (bfd_byte *) xmalloc (stabsize);
          if (! bfd_get_section_contents (abfd, sec, stabs, 0, stabsize))
            {
@@ -133,7 +133,7 @@ read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
              return FALSE;
            }
 
-         strsize = bfd_section_size (abfd, strsec);
+         strsize = bfd_section_size (strsec);
          strings = (bfd_byte *) xmalloc (strsize + 1);
          if (! bfd_get_section_contents (abfd, strsec, strings, 0, strsize))
            {
index 815f0a17336d8ec497f4e6cc847ed072e05b015a..9a0fcda2ac6ba4364350999d433bd70a4e24a61c 100644 (file)
@@ -141,7 +141,7 @@ read_coff_rsrc (const char *filename, const char *target)
     }
 
   set_windres_bfd (&wrbfd, abfd, sec, WR_KIND_BFD);
-  size = bfd_section_size (abfd, sec);
+  size = bfd_section_size (sec);
   /* PR 17512: file: 1b25ba5d
      The call to get_file_size here may be expensive
      but there is no other way to determine if the section size
@@ -155,8 +155,8 @@ read_coff_rsrc (const char *filename, const char *target)
   flaginfo.filename = filename;
   flaginfo.data = data;
   flaginfo.data_end = data + size;
-  flaginfo.secaddr = (bfd_get_section_vma (abfd, sec)
-                  - pe_data (abfd)->pe_opthdr.ImageBase);
+  flaginfo.secaddr = (bfd_section_vma (sec)
+                     - pe_data (abfd)->pe_opthdr.ImageBase);
 
   /* Now just read in the top level resource directory.  Note that we
      don't free data, since we create resource entries that point into
@@ -547,7 +547,7 @@ write_coff_file (const char *filename, const char *target,
            + cwi.dataentsize
            + cwi.resources.length);
 
-  if (! bfd_set_section_size (abfd, sec, length))
+  if (!bfd_set_section_size (sec, length))
     bfd_fatal ("bfd_set_section_size");
 
   bfd_set_reloc (abfd, sec, cwi.relocs, cwi.reloc_count);
index e9444bda0e119ef4e48582d3c39689b31b38323c..161ea354fec9cea0c80d1b8f21e42c642431f9c2 100644 (file)
@@ -142,7 +142,7 @@ write_res_file (const char *fn,const rc_res_directory *resdir)
   sec_length = write_res_directory ((windres_bfd *) NULL, 0x20UL, resdir,
                                    (const rc_res_id *) NULL,
                                    (const rc_res_id *) NULL, &language, 1);
-  if (! bfd_set_section_size (abfd, sec, (sec_length + 3) & ~3))
+  if (!bfd_set_section_size (sec, (sec_length + 3) & ~3))
     bfd_fatal ("bfd_set_section_size");
   if ((sec_length & 3) != 0)
     set_windres_bfd_content (&wrbfd, sign, sec_length, 4-(sec_length & 3));
index 479a4648877d9b6c14e36cc719a0bcda83ac26d3..b147221e916f03e6504b097a9a54ce934c47548f 100644 (file)
@@ -478,11 +478,11 @@ berkeley_or_gnu_sum (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr sec,
   flagword flags;
   bfd_size_type size;
 
-  flags = bfd_get_section_flags (abfd, sec);
+  flags = bfd_section_flags (sec);
   if ((flags & SEC_ALLOC) == 0)
     return;
 
-  size = bfd_get_section_size (sec);
+  size = bfd_section_size (sec);
   if ((flags & SEC_CODE) != 0
       || (selected_output_format == FORMAT_BERKLEY
          && (flags & SEC_READONLY) != 0))
@@ -557,21 +557,21 @@ static void
 sysv_internal_sizer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
                     void *ignore ATTRIBUTE_UNUSED)
 {
-  bfd_size_type size = bfd_section_size (file, sec);
+  bfd_size_type size = bfd_section_size (sec);
 
   if (   ! bfd_is_abs_section (sec)
       && ! bfd_is_com_section (sec)
       && ! bfd_is_und_section (sec))
     {
-      int namelen = strlen (bfd_section_name (file, sec));
+      int namelen = strlen (bfd_section_name (sec));
 
       if (namelen > svi_namelen)
        svi_namelen = namelen;
 
       svi_total += size;
 
-      if (bfd_section_vma (file, sec) > svi_maxvma)
-       svi_maxvma = bfd_section_vma (file, sec);
+      if (bfd_section_vma (sec) > svi_maxvma)
+       svi_maxvma = bfd_section_vma (sec);
     }
 }
 
@@ -589,7 +589,7 @@ static void
 sysv_internal_printer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
                       void *ignore ATTRIBUTE_UNUSED)
 {
-  bfd_size_type size = bfd_section_size (file, sec);
+  bfd_size_type size = bfd_section_size (sec);
 
   if (   ! bfd_is_abs_section (sec)
       && ! bfd_is_com_section (sec)
@@ -597,9 +597,9 @@ sysv_internal_printer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
     {
       svi_total += size;
 
-      sysv_one_line (bfd_section_name (file, sec),
+      sysv_one_line (bfd_section_name (sec),
                     size,
-                    bfd_section_vma (file, sec));
+                    bfd_section_vma (sec));
     }
 }
 
index 39c1a4f4e751d19a7ae6a64afd0fa825346b9798..a421f642e0be73f99a051e1457fab7df607cb219 100644 (file)
@@ -419,14 +419,14 @@ wr_ob (struct coff_ofile *p ATTRIBUTE_UNUSED, struct coff_section *section)
   unsigned char stuff[200];
 
   i = 0;
-  while (i < bfd_get_section_size (section->bfd_section))
+  while (i < bfd_section_size (section->bfd_section))
     {
       struct IT_ob ob;
       int todo = 200;          /* Copy in 200 byte lumps.  */
 
       ob.spare = 0;
-      if (i + todo > bfd_get_section_size (section->bfd_section))
-       todo = bfd_get_section_size (section->bfd_section) - i;
+      if (i + todo > bfd_section_size (section->bfd_section))
+       todo = bfd_section_size (section->bfd_section) - i;
 
       if (first)
        {
index ea48f92febad42674543baf96980c103f12db2f2..8150c1181df3250ad2dc5de4f38cdbfad1b7fa71 100644 (file)
@@ -332,7 +332,7 @@ strings_a_section (bfd *abfd, asection *sect, const char *filename,
   if ((sect->flags & DATA_FLAGS) != DATA_FLAGS)
     return;
 
-  sectsize = bfd_get_section_size (sect);
+  sectsize = bfd_section_size (sect);
   if (sectsize == 0)
     return;
 
index eaf4d6e4e1b9e76de698a0ccc904d0a473fbc386..10bd6144c698be69fe4e6d1009c3b3add7088b9c 100644 (file)
@@ -698,7 +698,7 @@ windmc_write_bin (const char *filename, mc_node_lang **nl, int elems)
       dta_off += mi[i].res_len;
     }
   sec_length = (dta_off + 3) & ~3;
-  if (! bfd_set_section_size (mc_bfd.abfd, mc_bfd.sec, sec_length))
+  if (!bfd_set_section_size (mc_bfd.sec, sec_length))
     bfd_fatal ("bfd_set_section_size");
   /* Make sure we write the complete block.  */
   set_windmc_bfd_content ("\0", sec_length - 1, 1);
index 3d61530a9b372297dad4d3007cf72a38b2a44865..819585d9e317d8f491a9c848b2f14358086629b9 100644 (file)
@@ -1,3 +1,31 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2019-09-18  Alan Modra  <amodra@gmail.com>
 
        * symbols.c (S_IS_LOCAL): Update bfd_get_section to
index c7bdf0cd8896c721f22439c46f0e0adfd2b9c5ff..d53db113e22ea868f69a3da29390813a0f1c52e3 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -1147,13 +1147,13 @@ perform_an_assembly_pass (int argc, char ** argv)
   /* @@ FIXME -- we're setting the RELOC flag so that sections are assumed
      to have relocs, otherwise we don't find out in time.  */
   applicable = bfd_applicable_section_flags (stdoutput);
-  bfd_set_section_flags (stdoutput, text_section,
+  bfd_set_section_flags (text_section,
                         applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
                                       | SEC_CODE | SEC_READONLY));
-  bfd_set_section_flags (stdoutput, data_section,
+  bfd_set_section_flags (data_section,
                         applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
                                       | SEC_DATA));
-  bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC);
+  bfd_set_section_flags (bss_section, applicable & SEC_ALLOC);
   seg_info (bss_section)->bss = 1;
 #endif
   subseg_new (BFD_ABS_SECTION_NAME, 0);
@@ -1360,7 +1360,7 @@ main (int argc, char ** argv)
       segT gnustack;
 
       gnustack = subseg_new (".note.GNU-stack", 0);
-      bfd_set_section_flags (stdoutput, gnustack,
+      bfd_set_section_flags (gnustack,
                             SEC_READONLY | (flag_execstack ? SEC_CODE : 0));
 
     }
index 96b551eded36cac858093bc2ff7fc0c678125207..5b604a45342205187bef6d96a6bb1f1f35c5423d 100644 (file)
--- a/gas/as.h
+++ b/gas/as.h
@@ -226,7 +226,7 @@ COMMON subsegT now_subseg;
 /* Segment our instructions emit to.  */
 COMMON segT now_seg;
 
-#define segment_name(SEG)      bfd_get_section_name (stdoutput, SEG)
+#define segment_name(SEG)      bfd_section_name (SEG)
 
 extern segT reg_section, expr_section;
 /* Shouldn't these be eliminated someday?  */
index 183be7925fc39fd6ec63da885c0850797209ce31..b24e435677b822780aac775ade997517deca867b 100644 (file)
@@ -48,7 +48,7 @@ get_pxdata_name (segT seg, const char *base_name)
   const char *name,*dollar, *dot;
   char *sname;
 
-  name = bfd_get_section_name (stdoutput, seg);
+  name = bfd_section_name (seg);
 
   dollar = strchr (name, '$');
   dot = strchr (name + 1, '.');
@@ -95,16 +95,16 @@ make_pxdata_seg (segT cseg, char *name)
 
   r = subseg_new (name, 0);
   /* Check if code segment is marked as linked once.  */
-  flags = bfd_get_section_flags (stdoutput, cseg)
-    & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
-       | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
-       | SEC_LINK_DUPLICATES_SAME_CONTENTS);
+  flags = (bfd_section_flags (cseg)
+          & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
+             | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
+             | SEC_LINK_DUPLICATES_SAME_CONTENTS));
 
   /* Add standard section flags.  */
   flags |= SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA;
 
   /* Apply possibly linked once flags to new generated segment, too.  */
-  if (!bfd_set_section_flags (stdoutput, r, flags))
+  if (!bfd_set_section_flags (r, flags))
     as_bad (_("bfd_set_section_flags: %s"),
            bfd_errmsg (bfd_get_error ()));
 
@@ -161,8 +161,8 @@ seh_validate_seg (const char *directive)
   const char *cseg_name, *nseg_name;
   if (seh_ctx_cur->code_seg == now_seg)
     return 1;
-  cseg_name = bfd_get_section_name (stdoutput, seh_ctx_cur->code_seg);
-  nseg_name = bfd_get_section_name (stdoutput, now_seg);
+  cseg_name = bfd_section_name (seh_ctx_cur->code_seg);
+  nseg_name = bfd_section_name (now_seg);
   as_bad (_("%s used in segment '%s' instead of expected '%s'"),
          directive, nseg_name, cseg_name);
   ignore_rest_of_line ();
index c4e1d71ce4e6ccfd46cd0cec6d5c69fcd7669248..d1dd0f0131a9dcf8cc3f7a68a38c4a4ef81abb09 100644 (file)
@@ -205,13 +205,12 @@ obj_coff_common_parse (int ignore ATTRIBUTE_UNUSED, symbolS *symbolP, addressT s
       char numbuff[20];
 
       sec = subseg_new (".drectve", 0);
-      oldflags = bfd_get_section_flags (stdoutput, sec);
+      oldflags = bfd_section_flags (sec);
       if (oldflags == SEC_NO_FLAGS)
        {
-         if (!bfd_set_section_flags (stdoutput, sec,
-               TC_COFF_SECTION_DEFAULT_ATTRIBUTES))
+         if (!bfd_set_section_flags (sec, TC_COFF_SECTION_DEFAULT_ATTRIBUTES))
            as_warn (_("error setting flags for \"%s\": %s"),
-               bfd_section_name (stdoutput, sec),
+               bfd_section_name (sec),
                bfd_errmsg (bfd_get_error ()));
        }
 
@@ -554,7 +553,7 @@ obj_coff_ident (int ignore ATTRIBUTE_UNUSED)
        that shouldn't be loaded into memory, which requires linker
        changes...  For now, until proven otherwise, use .rdata.  */
     sec = subseg_new (".rdata$zzz", 0);
-    bfd_set_section_flags (stdoutput, sec,
+    bfd_set_section_flags (sec,
                           ((SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA)
                            & bfd_applicable_section_flags (stdoutput)));
   }
@@ -774,8 +773,7 @@ obj_coff_endef (int ignore ATTRIBUTE_UNUSED)
 
   if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN
       || S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL
-      || (streq (bfd_get_section_name (stdoutput,
-                                      S_GET_SEGMENT (def_symbol_in_progress)),
+      || (streq (bfd_section_name (S_GET_SEGMENT (def_symbol_in_progress)),
                 "*DEBUG*")
          && !SF_GET_TAG (def_symbol_in_progress))
       || S_GET_SEGMENT (def_symbol_in_progress) == absolute_section
@@ -1480,7 +1478,7 @@ coff_adjust_section_syms (bfd *abfd ATTRIBUTE_UNUSED,
        fixp = fixp->fx_next;
       }
   }
-  if (bfd_get_section_size (sec) == 0
+  if (bfd_section_size (sec) == 0
       && nrelocs == 0
       && nlnno == 0
       && sec != text_section
@@ -1657,7 +1655,7 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
   if (alignment >= 0)
     sec->alignment_power = alignment;
 
-  oldflags = bfd_get_section_flags (stdoutput, sec);
+  oldflags = bfd_section_flags (sec);
   if (oldflags == SEC_NO_FLAGS)
     {
       /* Set section flags for a new section just created by subseg_new.
@@ -1673,9 +1671,9 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
        flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
 #endif
 
-      if (! bfd_set_section_flags (stdoutput, sec, flags))
+      if (!bfd_set_section_flags (sec, flags))
        as_warn (_("error setting flags for \"%s\": %s"),
-                bfd_section_name (stdoutput, sec),
+                bfd_section_name (sec),
                 bfd_errmsg (bfd_get_error ()));
     }
   else if (flags != SEC_NO_FLAGS)
@@ -1713,7 +1711,7 @@ coff_frob_section (segT sec)
      supposedly because standard COFF has no other way of encoding alignment
      for sections.  If your COFF flavor has a different way of encoding
      section alignment, then skip this step, as TICOFF does.  */
-  bfd_vma size = bfd_get_section_size (sec);
+  bfd_vma size = bfd_section_size (sec);
 #if !defined(TICOFF)
   bfd_vma align_power = (bfd_vma) sec->alignment_power + OCTETS_PER_BYTE_POWER;
   bfd_vma mask = ((bfd_vma) 1 << align_power) - 1;
@@ -1724,7 +1722,7 @@ coff_frob_section (segT sec)
       fragS *last;
 
       new_size = (size + mask) & ~mask;
-      bfd_set_section_size (stdoutput, sec, new_size);
+      bfd_set_section_size (sec, new_size);
 
       /* If the size had to be rounded up, add some padding in
          the last non-empty frag.  */
@@ -1751,7 +1749,7 @@ coff_frob_section (segT sec)
       unsigned char sclass = C_STAT;
 
 #ifdef OBJ_XCOFF
-      if (bfd_get_section_flags (stdoutput, sec) & SEC_DEBUGGING)
+      if (bfd_section_flags (sec) & SEC_DEBUGGING)
         sclass = C_DWARF;
 #endif
       S_SET_STORAGE_CLASS (secsym, sclass);
@@ -1772,9 +1770,9 @@ coff_frob_section (segT sec)
   strsec = sec;
   sec = subseg_get (STAB_SECTION_NAME, 0);
   /* size is already rounded up, since other section will be listed first */
-  size = bfd_get_section_size (strsec);
+  size = bfd_section_size (strsec);
 
-  n_entries = bfd_get_section_size (sec) / 12 - 1;
+  n_entries = bfd_section_size (sec) / 12 - 1;
 
   /* Find first non-empty frag.  It should be large enough.  */
   fragp = seg_info (sec)->frchainP->frch_root;
index b62176fe73ce1c0b7faf63de9a01c8a08c590dba..a5616f388e861ef4680b42c161d7f31b65332af5 100644 (file)
@@ -90,15 +90,15 @@ ecoff_frob_file_before_fix (void)
          }
       if (i == n_names)
        {
-         bfd_set_section_vma (stdoutput, sec, addr);
-         addr += bfd_section_size (stdoutput, sec);
+         bfd_set_section_vma (sec, addr);
+         addr += bfd_section_size (sec);
        }
     }
   for (i = 0; i < n_names; i++)
     if (secs[i])
       {
-       bfd_set_section_vma (stdoutput, secs[i], addr);
-       addr += bfd_section_size (stdoutput, secs[i]);
+       bfd_set_section_vma (secs[i], addr);
+       addr += bfd_section_size (secs[i]);
       }
   for (i = n_names - 1; i >= 0; i--)
     if (secs[i])
index bdf3da811999b18279b7d866b2e395cef7e3a565..56293584a0aa7065b4228f2b5d1b69e5e73b09c0 100644 (file)
@@ -737,7 +737,7 @@ obj_elf_change_section (const char *name,
       if (type == SHT_NOBITS)
        seg_info (sec)->bss = 1;
 
-      bfd_set_section_flags (stdoutput, sec, flags);
+      bfd_set_section_flags (sec, flags);
       if (flags & SEC_MERGE)
        sec->entsize = entsize;
       elf_group_name (sec) = group_name;
@@ -1859,9 +1859,7 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED)
 
       /* Create the .note section.  */
       note_secp = subseg_new (".note", 0);
-      bfd_set_section_flags (stdoutput,
-                            note_secp,
-                            SEC_HAS_CONTENTS | SEC_READONLY);
+      bfd_set_section_flags (note_secp, SEC_HAS_CONTENTS | SEC_READONLY);
       record_alignment (note_secp, 2);
 
       /* Process the version string.  */
@@ -2140,9 +2138,8 @@ obj_elf_ident (int ignore ATTRIBUTE_UNUSED)
     {
       char *p;
       comment_section = subseg_new (".comment", 0);
-      bfd_set_section_flags (stdoutput, comment_section,
-                            SEC_READONLY | SEC_HAS_CONTENTS
-                            | SEC_MERGE | SEC_STRINGS);
+      bfd_set_section_flags (comment_section, (SEC_READONLY | SEC_HAS_CONTENTS
+                                              | SEC_MERGE | SEC_STRINGS));
       comment_section->entsize = 1;
 #ifdef md_elf_section_change_hook
       md_elf_section_change_hook ();
@@ -2170,7 +2167,7 @@ obj_elf_init_stab_section (segT seg)
 
   /* Force the section to align to a longword boundary.  Without this,
      UnixWare ar crashes.  */
-  bfd_set_section_alignment (stdoutput, seg, 2);
+  bfd_set_section_alignment (seg, 2);
 
   /* Make space for this first symbol.  */
   p = frag_more (12);
@@ -2204,10 +2201,10 @@ adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
   name = concat (sec->name, "str", NULL);
   strsec = bfd_get_section_by_name (abfd, name);
   if (strsec)
-    strsz = bfd_section_size (abfd, strsec);
+    strsz = bfd_section_size (strsec);
   else
     strsz = 0;
-  nsyms = bfd_section_size (abfd, sec) / 12 - 1;
+  nsyms = bfd_section_size (sec) / 12 - 1;
 
   p = seg_info (sec)->stabu.p;
   gas_assert (p != 0);
@@ -2490,8 +2487,8 @@ elf_adjust_symtab (void)
       sec_name = ".group";
       s = subseg_force_new (sec_name, 0);
       if (s == NULL
-         || !bfd_set_section_flags (stdoutput, s, flags)
-         || !bfd_set_section_alignment (stdoutput, s, 2))
+         || !bfd_set_section_flags (s, flags)
+         || !bfd_set_section_alignment (s, 2))
        {
          as_fatal (_("can't create group: %s"),
                    bfd_errmsg (bfd_get_error ()));
@@ -2598,7 +2595,7 @@ elf_frob_file_after_relocs (void)
 
       group = elf_sec_group (head);
       subseg_set (group, 0);
-      bfd_set_section_size (stdoutput, group, size);
+      bfd_set_section_size (group, size);
       group->contents = (unsigned char *) frag_more (size);
       frag_now->fr_fix = frag_now_fix_octets ();
       frag_wane (frag_now);
@@ -2656,8 +2653,8 @@ elf_frob_file_after_relocs (void)
         to force the ELF backend to allocate a file position, and then
         write out the data.  FIXME: Is this really the best way to do
         this?  */
-      bfd_set_section_size
-       (stdoutput, sec, bfd_ecoff_debug_size (stdoutput, &debug, debug_swap));
+      bfd_set_section_size (sec, bfd_ecoff_debug_size (stdoutput, &debug,
+                                                      debug_swap));
 
       /* Pass BUF to bfd_set_section_contents because this will
         eventually become a call to fwrite, and ISO C prohibits
index 185949ee1fda6d21d79bca7ed34c7831b944f649..07c7831945e24e9fbc3f4c946e8f74174c58a01c 100644 (file)
@@ -227,7 +227,7 @@ obj_mach_o_make_or_get_sect (char * segname, char * sectname,
   /* Sub-segments don't exists as is on Mach-O.  */
   sec = subseg_new (name, 0);
 
-  oldflags = bfd_get_section_flags (stdoutput, sec);
+  oldflags = bfd_section_flags (sec);
   msect = bfd_mach_o_get_mach_o_section (sec);
 
   if (oldflags == SEC_NO_FLAGS)
@@ -245,9 +245,9 @@ obj_mach_o_make_or_get_sect (char * segname, char * sectname,
        flags |= SEC_DEBUGGING;
 
       /* New, so just use the defaults or what's specified.  */
-      if (! bfd_set_section_flags (stdoutput, sec, flags))
+      if (!bfd_set_section_flags (sec, flags))
        as_warn (_("failed to set flags for \"%s\": %s"),
-                bfd_section_name (stdoutput, sec),
+                bfd_section_name (sec),
                 bfd_errmsg (bfd_get_error ()));
 
       strncpy (msect->segname, segname, BFD_MACH_O_SEGNAME_SIZE);
@@ -1697,7 +1697,7 @@ static void
 obj_mach_o_set_section_vma (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *v_p)
 {
   bfd_mach_o_section *ms = bfd_mach_o_get_mach_o_section (sec);
-  unsigned bfd_align = bfd_get_section_alignment (abfd, sec);
+  unsigned bfd_align = bfd_section_alignment (sec);
   obj_mach_o_set_vma_data *p = (struct obj_mach_o_set_vma_data *)v_p;
   unsigned sectype = (ms->flags & BFD_MACH_O_SECTION_TYPE_MASK);
   unsigned zf;
@@ -1719,16 +1719,16 @@ obj_mach_o_set_section_vma (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *v_p
 
   /* We know the section size now - so make a vma for the section just
      based on order.  */
-  ms->size = bfd_get_section_size (sec);
+  ms->size = bfd_section_size (sec);
 
   /* Make sure that the align agrees, and set to the largest value chosen.  */
   ms->align = ms->align > bfd_align ? ms->align : bfd_align;
-  bfd_set_section_alignment (abfd, sec, ms->align);
+  bfd_set_section_alignment (sec, ms->align);
 
   p->vma += (1 << ms->align) - 1;
   p->vma &= ~((1 << ms->align) - 1);
   ms->addr = p->vma;
-  bfd_set_section_vma (abfd, sec, p->vma);
+  bfd_set_section_vma (sec, p->vma);
   p->vma += ms->size;
 }
 
@@ -1752,7 +1752,7 @@ static void
 obj_mach_o_set_indirect_symbols (bfd *abfd, asection *sec,
                                 void *xxx ATTRIBUTE_UNUSED)
 {
-  bfd_vma sect_size = bfd_section_size (abfd, sec);
+  bfd_vma sect_size = bfd_section_size (sec);
   bfd_mach_o_section *ms = bfd_mach_o_get_mach_o_section (sec);
   unsigned lazy = 0;
 
index edd49dc7f199b5cfb8835b5d339b7e40d1bb7e6d..20213b8b327c03fcbecb6be46f02e7c3b6223819 100644 (file)
@@ -224,14 +224,14 @@ obj_som_init_stab_section (segT seg)
      of the various stabs spaces/subspaces need to be "small".  We
      reserve range 72/73 which appear to work well.  */
   obj_set_section_attributes (space, 1, 1, 72, 2);
-  bfd_set_section_alignment (stdoutput, space, 2);
+  bfd_set_section_alignment (space, 2);
 
   /* Set the containing space for both stab sections to be $GDB_DEBUG$
      (just created above).  Also set some attributes which BFD does
      not understand.  In particular, access bits, sort keys, and load
      quadrant.  */
   obj_set_subsection_attributes (seg, space, 0x1f, 73, 0, 0, 0, 0);
-  bfd_set_section_alignment (stdoutput, seg, 2);
+  bfd_set_section_alignment (seg, 2);
 
   /* Make some space for the first special stab entry and zero the memory.
      It contains information about the length of this file's
@@ -254,7 +254,7 @@ obj_som_init_stab_section (segT seg)
      quadrant.  */
   seg = bfd_get_section_by_name (stdoutput, "$GDB_STRINGS$");
   obj_set_subsection_attributes (seg, space, 0x1f, 72, 0, 0, 0, 0);
-  bfd_set_section_alignment (stdoutput, seg, 2);
+  bfd_set_section_alignment (seg, 2);
 
   subseg_set (saved_seg, saved_subseg);
 }
@@ -273,10 +273,10 @@ adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
 
   strsec = bfd_get_section_by_name (abfd, "$GDB_STRINGS$");
   if (strsec)
-    strsz = bfd_section_size (abfd, strsec);
+    strsz = bfd_section_size (strsec);
   else
     strsz = 0;
-  nsyms = bfd_section_size (abfd, sec) / 12 - 1;
+  nsyms = bfd_section_size (sec) / 12 - 1;
 
   p = seg_info (sec)->stabu.p;
   gas_assert (p != 0);
index 735ecd6073546da03ae4d56bdb55e345bb6c5623..522efebfe42ed797e510b4694c2c51827f55728e 100644 (file)
@@ -7363,7 +7363,7 @@ aarch64_init_frag (fragS * fragP, int max_chars)
 
   /* PR 21809: Do not set a mapping state for debug sections
      - it just confuses other tools.  */
-  if (bfd_get_section_flags (NULL, now_seg) & SEC_DEBUGGING)
+  if (bfd_section_flags (now_seg) & SEC_DEBUGGING)
     return;
 
   switch (fragP->fr_type)
index 7f8003615740ee56b838422eee4e2fb7353bbb45..70ceba02c163fbccb0fa6c03e4a4d434fbf39ec3 100644 (file)
@@ -1205,10 +1205,9 @@ create_literal_section (const char *name,
 
   *secp = new_sec = subseg_new (name, 0);
   subseg_set (current_section, current_subsec);
-  bfd_set_section_alignment (stdoutput, new_sec, 4);
-  bfd_set_section_flags (stdoutput, new_sec,
-                        SEC_RELOC | SEC_ALLOC | SEC_LOAD | SEC_READONLY
-                        | SEC_DATA);
+  bfd_set_section_alignment (new_sec, 4);
+  bfd_set_section_flags (new_sec, (SEC_RELOC | SEC_ALLOC | SEC_LOAD
+                                  | SEC_READONLY | SEC_DATA));
 
   S_CLEAR_EXTERNAL (*symp = section_symbol (new_sec));
 }
@@ -3985,8 +3984,8 @@ s_alpha_stab (int n)
   if (alpha_flag_mdebug < 0)
     {
       segT sec = subseg_new (".mdebug", 0);
-      bfd_set_section_flags (stdoutput, sec, SEC_HAS_CONTENTS | SEC_READONLY);
-      bfd_set_section_alignment (stdoutput, sec, 3);
+      bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
+      bfd_set_section_alignment (sec, 3);
 
       ecoff_read_begin_hook ();
 
@@ -5301,7 +5300,7 @@ maybe_set_gp (asection *sec)
 
   if (!sec)
     return;
-  vma = bfd_get_section_vma (sec->owner, sec);
+  vma = bfd_section_vma (sec);
   if (vma && vma < alpha_gp_value)
     alpha_gp_value = vma;
 }
@@ -5515,8 +5514,8 @@ md_begin (void)
   if (ECOFF_DEBUGGING)
     {
       segT sec = subseg_new (".mdebug", (subsegT) 0);
-      bfd_set_section_flags (stdoutput, sec, SEC_HAS_CONTENTS | SEC_READONLY);
-      bfd_set_section_alignment (stdoutput, sec, 3);
+      bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
+      bfd_set_section_alignment (sec, 3);
     }
 #endif
 
@@ -5563,7 +5562,7 @@ md_assemble (char *str)
 valueT
 md_section_align (segT seg, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   valueT mask = ((valueT) 1 << align) - 1;
 
   return (size + mask) & ~mask;
index c1d5ea3d47024d8b2da74be4e25e19ea8edbcd19..c73906b51bb49596685cdf52a1e1c1efaf267a08 100644 (file)
@@ -2706,7 +2706,7 @@ valueT
 md_section_align (segT segment,
                  valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
 }
@@ -4529,8 +4529,7 @@ arc_set_ext_seg (void)
   if (!arcext_section)
     {
       arcext_section = subseg_new (".arcextmap", 0);
-      bfd_set_section_flags (stdoutput, arcext_section,
-                            SEC_READONLY | SEC_HAS_CONTENTS);
+      bfd_set_section_flags (arcext_section, SEC_READONLY | SEC_HAS_CONTENTS);
     }
   else
     subseg_set (arcext_section, 0);
index 32a15f65ec852bae54184ab29447f17ab84d8fec..b0f1507c360621cc269937f619b5c16f7882712a 100644 (file)
@@ -22878,7 +22878,7 @@ arm_frob_label (symbolS * sym)
      out of the jump table, and chaos would ensue.  */
   if (label_is_thumb_function_name
       && (S_GET_NAME (sym)[0] != '.' || S_GET_NAME (sym)[1] != 'L')
-      && (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+      && (bfd_section_flags (now_seg) & SEC_CODE) != 0)
     {
       /* When the address of a Thumb function is taken the bottom
         bit of that address should be set.  This will allow
@@ -26491,7 +26491,7 @@ arm_init_frag (fragS * fragP, int max_chars)
 
   /* PR 21809: Do not set a mapping state for debug sections
      - it just confuses other tools.  */
-  if (bfd_get_section_flags (NULL, now_seg) & SEC_DEBUGGING)
+  if (bfd_section_flags (now_seg) & SEC_DEBUGGING)
     return;
 
   frag_thumb_mode = fragP->tc_frag_data.thumb_mode ^ MODE_RECORDED;
@@ -30019,9 +30019,8 @@ md_begin (void)
 
        if (sec != NULL)
          {
-           bfd_set_section_flags
-             (stdoutput, sec, SEC_READONLY | SEC_DEBUGGING /* | SEC_HAS_CONTENTS */);
-           bfd_set_section_size (stdoutput, sec, 0);
+           bfd_set_section_flags (sec, SEC_READONLY | SEC_DEBUGGING);
+           bfd_set_section_size (sec, 0);
            bfd_set_section_contents (stdoutput, sec, NULL, 0, 0);
          }
       }
index df0833c761c0a08139bc513a6b9ea6e894a8b20b..36262ad8c0dceea43f49bac691c7217e63c83d14 100644 (file)
@@ -1429,7 +1429,7 @@ avr_operands (struct avr_opcodes_s *opcode, char **line)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & (-1UL << align));
 }
 
@@ -2229,7 +2229,7 @@ avr_create_property_section (void)
   sec = bfd_make_section (stdoutput, section_name);
   if (sec == NULL)
     as_fatal (_("Failed to create property section `%s'\n"), section_name);
-  bfd_set_section_flags (stdoutput, sec, flags);
+  bfd_set_section_flags (sec, flags);
   sec->output_section = sec;
   return sec;
 }
@@ -2404,7 +2404,7 @@ avr_create_and_fill_property_section (void)
     return;
 
   prop_sec = avr_create_property_section ();
-  bfd_set_section_size (stdoutput, prop_sec, sec_size);
+  bfd_set_section_size (prop_sec, sec_size);
 
   subseg_set (prop_sec, 0);
   frag_base = frag_more (sec_size);
index 104ab6aec9e10e3a38f71d78d2b8c1a1dd5aa0bb..5f10cb7fb4c77f6de1d093bcaec9b84224329512 100644 (file)
@@ -789,7 +789,7 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int boundary = bfd_get_section_alignment (stdoutput, segment);
+  int boundary = bfd_section_alignment (segment);
   return ((size + (1 << boundary) - 1) & -(1 << boundary));
 }
 
index d2da2feafb00707fadec05e836fc407b55fe8321..7c3bf2e718fcbfb0585ba9125bcf6ea65750598f 100644 (file)
@@ -189,7 +189,7 @@ md_begin (void)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index 9f6c82e1f94de8b04b035a0e1e2403d3d8f1cbcf..2eb679bb44267d6d52f3c1469861a11a428981fa 100644 (file)
@@ -268,7 +268,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
index 086215e306e32c92efe9f928e131f98fe157146e..a54945e1f3b3dd3e3b289ffb6c877345ac1909e4 100644 (file)
@@ -302,7 +302,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
@@ -1490,7 +1490,7 @@ d30v_align (int n, char *pfill, symbolS *label)
   if (pfill == NULL)
     {
       if (n > 2
-         && (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+         && (bfd_section_flags (now_seg) & SEC_CODE) != 0)
        {
          static char const nop[4] = { 0x00, 0xf0, 0x00, 0x00 };
 
index 5429fa9fb5f7ee3b9deac6d3ae919839f2f3098f..753cb6e0bf9bf0827fa338b763142cad823c96d8 100644 (file)
@@ -152,7 +152,7 @@ md_begin (void)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index 3703e29ccc814e0a1f3b85d8dfc966e57659c6aa..5767eeb616238c34fed718e7d1b65909f9e5f2da 100644 (file)
@@ -154,7 +154,7 @@ md_operand (expressionS * expressionP)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index 3112fce4f2140123b9efd95e24c9660c5fe58521..d8ff553294cfbae0a0b6697cd7423b250aa3da2e 100644 (file)
@@ -1225,7 +1225,7 @@ md_operand (expressionS *expressionP)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
@@ -1651,7 +1651,7 @@ frv_frob_file_section (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
   segment_info_type *seginfo = seg_info (sec);
   fixS *fixp;
   CGEN_CPU_DESC cd = gas_cgen_cpu_desc;
-  flagword flags = bfd_get_section_flags (abfd, sec);
+  flagword flags = bfd_section_flags (sec);
 
   /* Skip relocations in known sections (.ctors, .dtors, and .gcc_except_table)
      since we can fix those up by hand.  */
index 5ddc889a4da885c15345a387af26383d2c31f4e3..c79c6d42255dcb320125a9a827ab0443f69e31e4 100644 (file)
@@ -2225,7 +2225,7 @@ md_convert_frag (bfd *headers ATTRIBUTE_UNUSED,
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & (-1U << align));
 }
 
index 82c71ebbfc5748be09a62d2d13d5d0975461d3f9..fb6d82bc596072d42892d6c01275b1107afc4f70 100644 (file)
@@ -1608,7 +1608,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
 valueT
 md_section_align (asection *segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   int align2 = (1 << align) - 1;
 
   return (size + align2) & ~align2;
@@ -5962,7 +5962,7 @@ pa_build_unwind_subspace (struct call_info *call_info)
   char *name, *p;
   symbolS *symbolP;
 
-  if ((bfd_get_section_flags (stdoutput, now_seg)
+  if ((bfd_section_flags (now_seg)
        & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
       != (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
     return;
@@ -6006,10 +6006,9 @@ pa_build_unwind_subspace (struct call_info *call_info)
   if (seg == ASEC_NULL)
     {
       seg = subseg_new (UNWIND_SECTION_NAME, 0);
-      bfd_set_section_flags (stdoutput, seg,
-                            SEC_READONLY | SEC_HAS_CONTENTS
-                            | SEC_LOAD | SEC_RELOC | SEC_ALLOC | SEC_DATA);
-      bfd_set_section_alignment (stdoutput, seg, 2);
+      bfd_set_section_flags (seg, (SEC_READONLY | SEC_HAS_CONTENTS | SEC_LOAD
+                                  | SEC_RELOC | SEC_ALLOC | SEC_DATA));
+      bfd_set_section_alignment (seg, 2);
     }
 
   subseg_set (seg, 0);
@@ -7533,14 +7532,13 @@ pa_subspace (int create_new)
        seg_info (section)->bss = 1;
 
       /* Now set the flags.  */
-      bfd_set_section_flags (stdoutput, section, applicable);
+      bfd_set_section_flags (section, applicable);
 
       /* Record any alignment request for this section.  */
       record_alignment (section, exact_log2 (alignment));
 
       /* Set the starting offset for this section.  */
-      bfd_set_section_vma (stdoutput, section,
-                          pa_subspace_start (space, quadrant));
+      bfd_set_section_vma (section, pa_subspace_start (space, quadrant));
 
       /* Now that all the flags are set, update an existing subspace,
         or create a new one.  */
@@ -7614,7 +7612,7 @@ pa_spaces_begin (void)
        {
          text_section = segment;
          applicable = bfd_applicable_section_flags (stdoutput);
-         bfd_set_section_flags (stdoutput, segment,
+         bfd_set_section_flags (segment,
                                 applicable & (SEC_ALLOC | SEC_LOAD
                                               | SEC_RELOC | SEC_CODE
                                               | SEC_READONLY
@@ -7624,7 +7622,7 @@ pa_spaces_begin (void)
        {
          data_section = segment;
          applicable = bfd_applicable_section_flags (stdoutput);
-         bfd_set_section_flags (stdoutput, segment,
+         bfd_set_section_flags (segment,
                                 applicable & (SEC_ALLOC | SEC_LOAD
                                               | SEC_RELOC
                                               | SEC_HAS_CONTENTS));
@@ -7634,13 +7632,13 @@ pa_spaces_begin (void)
        {
          bss_section = segment;
          applicable = bfd_applicable_section_flags (stdoutput);
-         bfd_set_section_flags (stdoutput, segment,
+         bfd_set_section_flags (segment,
                                 applicable & SEC_ALLOC);
        }
       else if (!strcmp (pa_def_subspaces[i].name, "$LIT$"))
        {
          applicable = bfd_applicable_section_flags (stdoutput);
-         bfd_set_section_flags (stdoutput, segment,
+         bfd_set_section_flags (segment,
                                 applicable & (SEC_ALLOC | SEC_LOAD
                                               | SEC_RELOC
                                               | SEC_READONLY
@@ -7649,7 +7647,7 @@ pa_spaces_begin (void)
       else if (!strcmp (pa_def_subspaces[i].name, "$MILLICODE$"))
        {
          applicable = bfd_applicable_section_flags (stdoutput);
-         bfd_set_section_flags (stdoutput, segment,
+         bfd_set_section_flags (segment,
                                 applicable & (SEC_ALLOC | SEC_LOAD
                                               | SEC_RELOC
                                               | SEC_READONLY
@@ -7658,7 +7656,7 @@ pa_spaces_begin (void)
       else if (!strcmp (pa_def_subspaces[i].name, "$UNWIND$"))
        {
          applicable = bfd_applicable_section_flags (stdoutput);
-         bfd_set_section_flags (stdoutput, segment,
+         bfd_set_section_flags (segment,
                                 applicable & (SEC_ALLOC | SEC_LOAD
                                               | SEC_RELOC
                                               | SEC_READONLY
index 2710dcec724d1ff386129274c71e8928f5840c0d..fec69c1397df7bd60587f7765cd728d241d8c8c1 100644 (file)
@@ -8105,7 +8105,7 @@ x86_cleanup (void)
 
   /* Create the .note.gnu.property section.  */
   sec = subseg_new (NOTE_GNU_PROPERTY_SECTION_NAME, 0);
-  bfd_set_section_flags (stdoutput, sec,
+  bfd_set_section_flags (sec,
                         (SEC_ALLOC
                          | SEC_LOAD
                          | SEC_DATA
@@ -8123,7 +8123,7 @@ x86_cleanup (void)
       alignment = 2;
     }
 
-  bfd_set_section_alignment (stdoutput, sec, alignment);
+  bfd_set_section_alignment (sec, alignment);
   elf_section_type (sec) = SHT_NOTE;
 
   /* GNU_PROPERTY_X86_ISA_1_USED: 4-byte type + 4-byte data size
@@ -11939,7 +11939,7 @@ md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size)
         work.  */
       int align;
 
-      align = bfd_get_section_alignment (stdoutput, segment);
+      align = bfd_section_alignment (segment);
       size = ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
     }
 #endif
@@ -12382,8 +12382,7 @@ handle_large_common (int small ATTRIBUTE_UNUSED)
          /* The .lbss section is for local .largecomm symbols.  */
          lbss_section = subseg_new (".lbss", 0);
          applicable = bfd_applicable_section_flags (stdoutput);
-         bfd_set_section_flags (stdoutput, lbss_section,
-                                applicable & SEC_ALLOC);
+         bfd_set_section_flags (lbss_section, applicable & SEC_ALLOC);
          seg_info (lbss_section)->bss = 1;
 
          subseg_set (seg, subseg);
index 8f25e557e09203385e19766c8aa67d7c3964574c..0c618e811eeb701a88f92b459de5810540ad7bdc 100644 (file)
@@ -1152,14 +1152,14 @@ obj_elf_vms_common (int ignore ATTRIBUTE_UNUSED)
 
   record_alignment (now_seg, log_align);
 
-  cur_size = bfd_section_size (stdoutput, now_seg);
+  cur_size = bfd_section_size (now_seg);
   if ((int) size > cur_size)
     {
       char *pfrag
         = frag_var (rs_fill, 1, 1, (relax_substateT)0, NULL,
                     (valueT)size - (valueT)cur_size, NULL);
       *pfrag = 0;
-      bfd_section_size (stdoutput, now_seg) = size;
+      bfd_set_section_size (now_seg, size);
     }
 
   /* Switch back to current segment.  */
@@ -3606,8 +3606,7 @@ start_unwind_section (const segT text_seg, int sec_index)
   else
     {
       set_section (sec_name);
-      bfd_set_section_flags (stdoutput, now_seg,
-                            SEC_LOAD | SEC_ALLOC | SEC_READONLY);
+      bfd_set_section_flags (now_seg, SEC_LOAD | SEC_ALLOC | SEC_READONLY);
     }
 
   elf_linked_to_section (now_seg) = text_seg;
@@ -7250,7 +7249,7 @@ md_begin (void)
   md.auto_align = 1;
   md.explicit_mode = md.default_explicit_mode;
 
-  bfd_set_section_alignment (stdoutput, text_section, 4);
+  bfd_set_section_alignment (text_section, 4);
 
   /* Make sure function pointers get initialized.  */
   target_big_endian = -1;
@@ -7778,7 +7777,7 @@ ia64_frob_label (struct symbol *sym)
       return;
     }
 
-  if (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)
+  if (bfd_section_flags (now_seg) & SEC_CODE)
     {
       md.last_text_seg = now_seg;
       fix = XOBNEW (&notes, struct label_fix);
@@ -7818,7 +7817,7 @@ void
 ia64_flush_pending_output (void)
 {
   if (!md.keep_pending_output
-      && bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)
+      && bfd_section_flags (now_seg) & SEC_CODE)
     {
       /* ??? This causes many unnecessary stop bits to be emitted.
         Unfortunately, it isn't clear if it is safe to remove this.  */
@@ -10989,7 +10988,7 @@ ia64_pcrel_from_section (fixS *fix, segT sec)
 {
   unsigned long off = fix->fx_frag->fr_address + fix->fx_where;
 
-  if (bfd_get_section_flags (stdoutput, sec) & SEC_CODE)
+  if (bfd_section_flags (sec) & SEC_CODE)
     off &= ~0xfUL;
 
   return off;
@@ -11946,9 +11945,7 @@ ia64_vms_note (void)
   /* Create the .note section.  */
 
   secp = subseg_new (".note", 0);
-  bfd_set_section_flags (stdoutput,
-                        secp,
-                        SEC_HAS_CONTENTS | SEC_READONLY);
+  bfd_set_section_flags (secp, SEC_HAS_CONTENTS | SEC_READONLY);
 
   /* Module header note (MHD).  */
   bname = xstrdup (lbasename (out_file_name));
@@ -11993,9 +11990,7 @@ ia64_vms_note (void)
   frag_align (3, 0, 0);
 
   secp = subseg_new (".vms_display_name_info", 0);
-  bfd_set_section_flags (stdoutput,
-                        secp,
-                        SEC_HAS_CONTENTS | SEC_READONLY);
+  bfd_set_section_flags (secp, SEC_HAS_CONTENTS | SEC_READONLY);
 
   /* This symbol should be passed on the command line and be variable
      according to language.  */
index 0fcc0003d1915fc6a9caa015764aad74063062cc..53b4d88f111aa33bc3d4460dbb02a24f6de0019b 100644 (file)
@@ -213,7 +213,7 @@ md_assemble (char * str)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index 3275d301f7c8d4fdbb37fa67f37ad569fefe42e8..d2a0c59848306451508e75cebf57261e96cc535d 100644 (file)
@@ -430,7 +430,7 @@ md_assemble (char * str)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
@@ -817,7 +817,7 @@ s_iq2000_end (int x ATTRIBUTE_UNUSED)
   else
     p = NULL;
 
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     maybe_text = 1;
   else
     maybe_text = 0;
@@ -916,7 +916,7 @@ s_iq2000_ent (int aent)
   if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-')
     get_number ();
 
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     maybe_text = 1;
   else
     maybe_text = 0;
index a547ba9b5b010f50483eab9915475d834c4f25a3..75a733a6f22839c3552da86235b3d8b444107cf9 100644 (file)
@@ -277,7 +277,7 @@ md_undefined_symbol (char * name ATTRIBUTE_UNUSED)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
index 851d4c1971a8aea6d0daa45c90a70aef02f007da..3ea3e5997407ee93a1d3841b2e738dc8f3dc1c9b 100644 (file)
@@ -392,7 +392,7 @@ md_operand (expressionS * exp)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
index c20cb72ce177fb251c814678565661f88d6e4825..75ee9d93dedc130145cc7b25a55e9ae9548fc6bc 100644 (file)
@@ -713,7 +713,7 @@ md_begin (void)
 
   /* This is copied from perform_an_assembly_pass.  */
   applicable = bfd_applicable_section_flags (stdoutput);
-  bfd_set_section_flags (stdoutput, sbss_section, applicable & SEC_ALLOC);
+  bfd_set_section_flags (sbss_section, applicable & SEC_ALLOC);
 
   subseg_set (seg, subseg);
 
@@ -1448,7 +1448,7 @@ md_operand (expressionS *expressionP)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index 11514963bc894da4a4760259a74ff60ea2a5e8d3..1c36d5d98cba01efd4ee0f38bca0d21cbf467fa5 100644 (file)
@@ -583,7 +583,7 @@ md_atof (int type, char *litP, int *sizeP)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
index f53bb17022331d04c6e530305aea40e832c3b9da..c0d48e835437fb68fcb834d6f6db24a952957cfd 100644 (file)
@@ -1380,7 +1380,7 @@ md_assemble (char * str)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
@@ -1528,7 +1528,7 @@ md_estimate_size_before_relax (fragS * fragP, segT segment)
       || S_IS_WEAK (fragP->fr_symbol)
 #ifdef MEP_IVC2_SUPPORTED
       || (mep_cop == EF_MEP_COP_IVC2
-         && bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)
+         && bfd_section_flags (segment) & SEC_MEP_VLIW)
 #endif /* MEP_IVC2_SUPPORTED */
       )
     {
@@ -1539,7 +1539,7 @@ md_estimate_size_before_relax (fragS * fragP, segT segment)
     }
 
   if (MEP_VLIW && ! MEP_VLIW64
-      && (bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW))
+      && (bfd_section_flags (segment) & SEC_MEP_VLIW))
     {
       /* Use 32 bit branches for vliw32 so the vliw word is not split.  */
       switch (fragP->fr_cgen.insn->base->num)
@@ -1572,7 +1572,7 @@ md_estimate_size_before_relax (fragS * fragP, segT segment)
 
 #ifdef MEP_IVC2_SUPPORTED
   if (mep_cop == EF_MEP_COP_IVC2
-      && bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)
+      && bfd_section_flags (segment) & SEC_MEP_VLIW)
     return 0;
 #endif /* MEP_IVC2_SUPPORTED */
 
@@ -1587,7 +1587,7 @@ mep_relax_frag (segT segment, fragS *fragP, long stretch)
   long rv = relax_frag (segment, fragP, stretch);
 #ifdef MEP_IVC2_SUPPORTED
   if (mep_cop == EF_MEP_COP_IVC2
-      && bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)
+      && bfd_section_flags (segment) & SEC_MEP_VLIW)
     return 0;
 #endif
   return rv;
@@ -1624,7 +1624,7 @@ md_convert_frag (bfd *abfd  ATTRIBUTE_UNUSED,
   int core_mode;
 
 #ifdef MEP_IVC2_SUPPORTED
-  if (bfd_get_section_flags (stdoutput, seg) & SEC_MEP_VLIW
+  if (bfd_section_flags (seg) & SEC_MEP_VLIW
       && mep_cop == EF_MEP_COP_IVC2)
     core_mode = 0;
   else
@@ -2110,7 +2110,7 @@ mep_vtext_section (void)
     {
       flagword applicable = bfd_applicable_section_flags (stdoutput);
       vtext_section = subseg_new (VTEXT_SECTION_NAME, 0);
-      bfd_set_section_flags (stdoutput, vtext_section,
+      bfd_set_section_flags (vtext_section,
                             applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
                                           | SEC_CODE | SEC_READONLY
                                           | SEC_MEP_VLIW));
index c9ab452b3e8f1067b665fdd1785d8d63be2a8b89..2f68d688eadf2374214e7abbd2ff4d049f098026 100644 (file)
@@ -2011,8 +2011,7 @@ md_apply_fix (fixS *   fixP,
     {
       if (S_IS_WEAK (fixP->fx_addsy)
          || (symbol_used_in_reloc_p (fixP->fx_addsy)
-             && (((bfd_get_section_flags (stdoutput,
-                                          S_GET_SEGMENT (fixP->fx_addsy))
+             && (((bfd_section_flags (S_GET_SEGMENT (fixP->fx_addsy))
                    & SEC_LINK_ONCE) != 0)
                  || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
                               ".gnu.linkonce",
index a386d11f6c2451430936500c06754c2bfb5c2c06..b2e49730c0eb3d5b5c041d3c62938017ecdc529e 100644 (file)
@@ -3859,9 +3859,9 @@ md_begin (void)
   if (strncmp (TARGET_OS, "elf", 3) != 0
       && strncmp (TARGET_OS, "vxworks", 7) != 0)
     {
-      (void) bfd_set_section_alignment (stdoutput, text_section, 4);
-      (void) bfd_set_section_alignment (stdoutput, data_section, 4);
-      (void) bfd_set_section_alignment (stdoutput, bss_section, 4);
+      bfd_set_section_alignment (text_section, 4);
+      bfd_set_section_alignment (data_section, 4);
+      bfd_set_section_alignment (bss_section, 4);
     }
 
   /* Create a .reginfo section for register masks and a .mdebug
@@ -3886,8 +3886,8 @@ md_begin (void)
       {
        sec = subseg_new (".reginfo", (subsegT) 0);
 
-       bfd_set_section_flags (stdoutput, sec, flags);
-       bfd_set_section_alignment (stdoutput, sec, HAVE_NEWABI ? 3 : 2);
+       bfd_set_section_flags (sec, flags);
+       bfd_set_section_alignment (sec, HAVE_NEWABI ? 3 : 2);
 
        mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo));
       }
@@ -3896,8 +3896,8 @@ md_begin (void)
        /* The 64-bit ABI uses a .MIPS.options section rather than
           .reginfo section.  */
        sec = subseg_new (".MIPS.options", (subsegT) 0);
-       bfd_set_section_flags (stdoutput, sec, flags);
-       bfd_set_section_alignment (stdoutput, sec, 3);
+       bfd_set_section_flags (sec, flags);
+       bfd_set_section_alignment (sec, 3);
 
        /* Set up the option header.  */
        {
@@ -3918,25 +3918,23 @@ md_begin (void)
       }
 
     sec = subseg_new (".MIPS.abiflags", (subsegT) 0);
-    bfd_set_section_flags (stdoutput, sec,
+    bfd_set_section_flags (sec,
                           SEC_READONLY | SEC_DATA | SEC_ALLOC | SEC_LOAD);
-    bfd_set_section_alignment (stdoutput, sec, 3);
+    bfd_set_section_alignment (sec, 3);
     mips_flags_frag = frag_more (sizeof (Elf_External_ABIFlags_v0));
 
     if (ECOFF_DEBUGGING)
       {
        sec = subseg_new (".mdebug", (subsegT) 0);
-       (void) bfd_set_section_flags (stdoutput, sec,
-                                     SEC_HAS_CONTENTS | SEC_READONLY);
-       (void) bfd_set_section_alignment (stdoutput, sec, 2);
+       bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
+       bfd_set_section_alignment (sec, 2);
       }
     else if (mips_flag_pdr)
       {
        pdr_seg = subseg_new (".pdr", (subsegT) 0);
-       (void) bfd_set_section_flags (stdoutput, pdr_seg,
-                                     SEC_READONLY | SEC_RELOC
-                                     | SEC_DEBUGGING);
-       (void) bfd_set_section_alignment (stdoutput, pdr_seg, 2);
+       bfd_set_section_flags (pdr_seg,
+                              SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
+       bfd_set_section_alignment (pdr_seg, 2);
       }
 
     subseg_set (seg, subseg);
@@ -4468,7 +4466,7 @@ s_is_linkonce (symbolS *sym, segT from_seg)
 
   if (symseg != from_seg && !S_IS_LOCAL (sym))
     {
-      if ((bfd_get_section_flags (stdoutput, symseg) & SEC_LINK_ONCE))
+      if ((bfd_section_flags (symseg) & SEC_LINK_ONCE))
        linkonce = TRUE;
       /* The GNU toolchain uses an extension for ELF: a section
         beginning with the magic string .gnu.linkonce is a
@@ -6180,7 +6178,7 @@ match_float_constant (struct mips_arg_info *arg, expressionS *imm,
     }
 
   new_seg = subseg_new (newname, (subsegT) 0);
-  bfd_set_section_flags (stdoutput, new_seg,
+  bfd_set_section_flags (new_seg,
                         SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA);
   frag_align (length == 4 ? 2 : 3, 0, 0);
   if (strncmp (TARGET_OS, "elf", 3) != 0)
@@ -16128,7 +16126,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
               && fixP->fx_done
               && fixP->fx_frag->fr_address >= text_section->vma
               && (fixP->fx_frag->fr_address
-                  < text_section->vma + bfd_get_section_size (text_section))
+                  < text_section->vma + bfd_section_size (text_section))
               && ((insn & 0xffff0000) == 0x10000000     /* beq $0,$0 */
                   || (insn & 0xffff0000) == 0x04010000  /* bgez $0 */
                   || (insn & 0xffff0000) == 0x04110000)) /* bgezal $0 */
@@ -16319,9 +16317,8 @@ s_change_sec (int sec)
     case 'r':
       seg = subseg_new (RDATA_SECTION_NAME,
                        (subsegT) get_absolute_expression ());
-      bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD
-                                             | SEC_READONLY | SEC_RELOC
-                                             | SEC_DATA));
+      bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY
+                                  | SEC_RELOC | SEC_DATA));
       if (strncmp (TARGET_OS, "elf", 3) != 0)
        record_alignment (seg, 4);
       demand_empty_rest_of_line ();
@@ -16329,7 +16326,7 @@ s_change_sec (int sec)
 
     case 's':
       seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
-      bfd_set_section_flags (stdoutput, seg,
+      bfd_set_section_flags (seg,
                             SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
       if (strncmp (TARGET_OS, "elf", 3) != 0)
        record_alignment (seg, 4);
@@ -16338,7 +16335,7 @@ s_change_sec (int sec)
 
     case 'B':
       seg = subseg_new (".sbss", (subsegT) get_absolute_expression ());
-      bfd_set_section_flags (stdoutput, seg, SEC_ALLOC);
+      bfd_set_section_flags (seg, SEC_ALLOC);
       if (strncmp (TARGET_OS, "elf", 3) != 0)
        record_alignment (seg, 4);
       demand_empty_rest_of_line ();
@@ -17603,7 +17600,7 @@ tc_get_register (int frame)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
 
   /* We don't need to align ELF sections to the full alignment.
      However, Irix 5 may prefer that we align them at least to a 16
@@ -19760,7 +19757,7 @@ s_mips_end (int x ATTRIBUTE_UNUSED)
   else
     p = NULL;
 
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) == 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) == 0)
     as_warn (_(".end not in text section"));
 
   if (!cur_proc_ptr)
@@ -19850,7 +19847,7 @@ s_mips_ent (int aent)
       || *input_line_pointer == '-')
     get_number ();
 
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) == 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) == 0)
     as_warn (_(".ent or .aent not in text section"));
 
   if (!aent && cur_proc_ptr)
index 317805923dcf726626b331e8d3accc114384033a..1514b6d0607d41a4e57afefa20e0d05e37eb2075 100644 (file)
@@ -2130,9 +2130,8 @@ s_bspec (int unused ATTRIBUTE_UNUSED)
       if (sec == NULL)
        as_fatal (_("can't create section %s"), newsecname);
 
-      if (!bfd_set_section_flags (stdoutput, sec,
-                                 bfd_get_section_flags (stdoutput, sec)
-                                 | SEC_READONLY))
+      if (!bfd_set_section_flags (sec,
+                                 bfd_section_flags (sec) | SEC_READONLY))
        as_fatal (_("can't set section flags for section %s"), newsecname);
     }
 
@@ -2638,7 +2637,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
      than just helping the user around this limitation here; hopefully the
      code using the local expression is around.  Putting the LOCAL
      semantics in a relocation still seems right; a section didn't do.  */
-  if (bfd_section_size (section->owner, section) == 0)
+  if (bfd_section_size (section) == 0)
     as_bad_where
       (fixP->fx_file, fixP->fx_line,
        fixP->fx_r_type == BFD_RELOC_MMIX_LOCAL
@@ -2708,7 +2707,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
         resolve the relocation here.  */
       if (addsy != NULL
          && (bfd_is_und_section (addsec)
-             || strcmp (bfd_get_section_name (addsec->owner, addsec),
+             || strcmp (bfd_section_name (addsec),
                         MMIX_REG_CONTENTS_SECTION_NAME) == 0))
        {
          code = fixP->fx_r_type;
@@ -2735,7 +2734,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
 
     case BFD_RELOC_MMIX_BASE_PLUS_OFFSET:
       if (addsy != NULL
-         && strcmp (bfd_get_section_name (addsec->owner, addsec),
+         && strcmp (bfd_section_name (addsec),
                     MMIX_REG_CONTENTS_SECTION_NAME) == 0)
        {
          /* This changed into a register; the relocation is for the
@@ -2838,7 +2837,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
     case BFD_RELOC_MMIX_REG:
       if (addsy != NULL
          && (bfd_is_und_section (addsec)
-             || strcmp (bfd_get_section_name (addsec->owner, addsec),
+             || strcmp (bfd_section_name (addsec),
                         MMIX_REG_CONTENTS_SECTION_NAME) == 0))
        {
          code = fixP->fx_r_type;
@@ -3794,7 +3793,7 @@ mmix_frob_file (void)
   if (real_reg_section != NULL)
     {
       /* FIXME: Pass error state gracefully.  */
-      if (bfd_get_section_flags (stdoutput, real_reg_section) & SEC_HAS_CONTENTS)
+      if (bfd_section_flags (real_reg_section) & SEC_HAS_CONTENTS)
        as_fatal (_("register section has contents\n"));
 
       bfd_section_list_remove (stdoutput, real_reg_section);
@@ -3924,7 +3923,7 @@ mmix_md_elf_section_change_hook (void)
   if (doing_bspec)
     as_bad (_("section change from within a BSPEC/ESPEC pair is not supported"));
 
-  last_alignment = bfd_get_section_alignment (now_seg->owner, now_seg);
+  last_alignment = bfd_section_alignment (now_seg);
   want_unaligned = 0;
 }
 
index 045016bcba04f297ed5d2a55186fd7dbf396cb64..ebc011b1a6da917edde3b6fb6bdf3da659ee5377 100644 (file)
@@ -675,7 +675,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
index 15e6e27b2442717ec54e383b437a2754961486e0..1a41731379f01454b8c79f1d06b402aaca9f0596 100644 (file)
@@ -900,7 +900,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
 
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
@@ -2616,7 +2616,7 @@ mn10300_handle_align (fragS *frag)
       && now_seg != bss_section
       /* Do not create relocs for the merging sections - such
         relocs will prevent the contents from being merged.  */
-      && (bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE) == 0)
+      && (bfd_section_flags (now_seg) & SEC_MERGE) == 0)
     /* Create a new fixup to record the alignment request.  The symbol is
        irrelevant but must be present so we use the absolute section symbol.
        The offset from the symbol is used to record the power-of-two alignment
index 5821b1c81108de78fcf6930f2d04d350fad7aa88..56d202434999613a44bc4930ce5652035315e03b 100644 (file)
@@ -4239,7 +4239,7 @@ md_assemble (char * str)
 valueT
 md_section_align (asection * seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
 
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
index bd518547e31ed681d3646aa96ea81ccab596daa2..5b938aa2a9301524a7b9a52555c5fd1daf63bba0 100644 (file)
@@ -333,7 +333,7 @@ md_assemble (char * str)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index d01ca3d20261145743e8be1d2ff8d4dbcf3c18fc..36ed58a453814b5c56ce7523074fd9ec05bef38c 100644 (file)
@@ -3841,7 +3841,7 @@ do_nds32_seg (int i, subsegT sub)
       seg->s = subseg_new (seg->name, sub);
       if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
        {
-         bfd_set_section_flags (stdoutput, seg->s, seg->flags);
+         bfd_set_section_flags (seg->s, seg->flags);
          if ((seg->flags & SEC_LOAD) == 0)
            seg_info (seg->s)->bss = 1;
        }
@@ -6609,7 +6609,7 @@ md_operand (expressionS *expressionP)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & ((valueT) -1 << align));
 }
@@ -7569,7 +7569,7 @@ nds32_set_section_relocs (asection *sec, arelent ** relocs ATTRIBUTE_UNUSED,
                          unsigned int n ATTRIBUTE_UNUSED)
 {
   bfd *abfd ATTRIBUTE_UNUSED = sec->owner;
-  if (bfd_get_section_flags (abfd, sec) & (flagword) SEC_RELOC)
+  if (bfd_section_flags (sec) & (flagword) SEC_RELOC)
     nds32_insertion_sort (sec->orelocation, sec->reloc_count,
                          sizeof (arelent**), compar_relent);
 }
index 28fa7c50104e861b2fe360347c13201cc121998b..e29d4dd77d065e680c84664491f12dfc3ea503ff 100644 (file)
@@ -165,7 +165,7 @@ md_operand (expressionS * expressionP)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
index 042c95b1889f8ecaa6d19e2c09d825c48940e4f4..156f62c6fc07e2d945d91fb817352bc4f158c0fa 100644 (file)
@@ -1975,9 +1975,7 @@ ppc_cleanup (void)
 
     /* Create the .PPC.EMB.apuinfo section.  */
     apuinfo_secp = subseg_new (APUINFO_SECTION_NAME, 0);
-    bfd_set_section_flags (stdoutput,
-                          apuinfo_secp,
-                          SEC_HAS_CONTENTS | SEC_READONLY);
+    bfd_set_section_flags (apuinfo_secp, SEC_HAS_CONTENTS | SEC_READONLY);
 
     p = frag_more (4);
     md_number_to_chars (p, (valueT) 8, 4);
@@ -2703,7 +2701,7 @@ ppc_frob_file_before_adjust (void)
   toc = bfd_get_section_by_name (stdoutput, ".toc");
   if (toc != NULL
       && toc_reloc_types != has_large_toc_reloc
-      && bfd_section_size (stdoutput, toc) > 0x10000)
+      && bfd_section_size (toc) > 0x10000)
     as_warn (_("TOC section size exceeds 64k"));
 }
 
@@ -4681,14 +4679,14 @@ ppc_change_debug_section (unsigned int idx, subsegT subseg)
   const struct xcoff_dwsect_name *dw = &xcoff_dwsect_names[idx];
 
   sec = subseg_new (dw->name, subseg);
-  oldflags = bfd_get_section_flags (stdoutput, sec);
+  oldflags = bfd_section_flags (sec);
   if (oldflags == SEC_NO_FLAGS)
     {
       /* Just created section.  */
       gas_assert (dw_sections[idx].sect == NULL);
 
-      bfd_set_section_flags (stdoutput, sec, SEC_DEBUGGING);
-      bfd_set_section_alignment (stdoutput, sec, 0);
+      bfd_set_section_flags (sec, SEC_DEBUGGING);
+      bfd_set_section_alignment (sec, 0);
       dw_sections[idx].sect = sec;
     }
 
@@ -5804,11 +5802,10 @@ ppc_pdata (int ignore ATTRIBUTE_UNUSED)
     {
       pdata_section = subseg_new (".pdata", 0);
 
-      bfd_set_section_flags (stdoutput, pdata_section,
-                            (SEC_ALLOC | SEC_LOAD | SEC_RELOC
-                             | SEC_READONLY | SEC_DATA ));
+      bfd_set_section_flags (pdata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+                                            | SEC_READONLY | SEC_DATA));
 
-      bfd_set_section_alignment (stdoutput, pdata_section, 2);
+      bfd_set_section_alignment (pdata_section, 2);
     }
   else
     {
@@ -5837,11 +5834,10 @@ ppc_ydata (int ignore ATTRIBUTE_UNUSED)
   if (ydata_section == 0)
     {
       ydata_section = subseg_new (".ydata", 0);
-      bfd_set_section_flags (stdoutput, ydata_section,
-                            (SEC_ALLOC | SEC_LOAD | SEC_RELOC
-                             | SEC_READONLY | SEC_DATA ));
+      bfd_set_section_flags (ydata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+                                            | SEC_READONLY | SEC_DATA ));
 
-      bfd_set_section_alignment (stdoutput, ydata_section, 3);
+      bfd_set_section_alignment (ydata_section, 3);
     }
   else
     {
@@ -5874,11 +5870,10 @@ ppc_reldata (int ignore ATTRIBUTE_UNUSED)
     {
       reldata_section = subseg_new (".reldata", 0);
 
-      bfd_set_section_flags (stdoutput, reldata_section,
-                            (SEC_ALLOC | SEC_LOAD | SEC_RELOC
-                             | SEC_DATA));
+      bfd_set_section_flags (reldata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+                                              | SEC_DATA));
 
-      bfd_set_section_alignment (stdoutput, reldata_section, 2);
+      bfd_set_section_alignment (reldata_section, 2);
     }
   else
     {
@@ -5903,11 +5898,10 @@ ppc_rdata (int ignore ATTRIBUTE_UNUSED)
   if (rdata_section == 0)
     {
       rdata_section = subseg_new (".rdata", 0);
-      bfd_set_section_flags (stdoutput, rdata_section,
-                            (SEC_ALLOC | SEC_LOAD | SEC_RELOC
-                             | SEC_READONLY | SEC_DATA ));
+      bfd_set_section_flags (rdata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+                                            | SEC_READONLY | SEC_DATA ));
 
-      bfd_set_section_alignment (stdoutput, rdata_section, 2);
+      bfd_set_section_alignment (rdata_section, 2);
     }
   else
     {
@@ -6261,13 +6255,13 @@ ppc_pe_section (int ignore ATTRIBUTE_UNUSED)
 
   if (flags != SEC_NO_FLAGS)
     {
-      if (! bfd_set_section_flags (stdoutput, sec, flags))
+      if (!bfd_set_section_flags (sec, flags))
        as_bad (_("error setting flags for \"%s\": %s"),
-               bfd_section_name (stdoutput, sec),
+               bfd_section_name (sec),
                bfd_errmsg (bfd_get_error ()));
     }
 
-  bfd_set_section_alignment (stdoutput, sec, align);
+  bfd_set_section_alignment (sec, align);
 }
 
 static void
@@ -6298,11 +6292,10 @@ ppc_pe_tocd (int ignore ATTRIBUTE_UNUSED)
     {
       tocdata_section = subseg_new (".tocd", 0);
       /* FIXME: section flags won't work.  */
-      bfd_set_section_flags (stdoutput, tocdata_section,
-                            (SEC_ALLOC | SEC_LOAD | SEC_RELOC
-                             | SEC_READONLY | SEC_DATA));
+      bfd_set_section_flags (tocdata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+                                              | SEC_READONLY | SEC_DATA));
 
-      bfd_set_section_alignment (stdoutput, tocdata_section, 2);
+      bfd_set_section_alignment (tocdata_section, 2);
     }
   else
     {
@@ -6573,8 +6566,7 @@ ppc_frob_symbol (symbolS *sym)
          /* This is a csect symbol.  x_scnlen is the size of the
             csect.  */
          if (symbol_get_tc (sym)->next == (symbolS *) NULL)
-           a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
-                                                      S_GET_SEGMENT (sym))
+           a->x_csect.x_scnlen.l = (bfd_section_size (S_GET_SEGMENT (sym))
                                     - S_GET_VALUE (sym));
          else
            {
@@ -6622,8 +6614,7 @@ ppc_frob_symbol (symbolS *sym)
              || symbol_get_tc (next)->symbol_class != XMC_TC)
            {
              if (ppc_after_toc_frag == (fragS *) NULL)
-               a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
-                                                          data_section)
+               a->x_csect.x_scnlen.l = (bfd_section_size (data_section)
                                         - S_GET_VALUE (sym));
              else
                a->x_csect.x_scnlen.l = (ppc_after_toc_frag->fr_address
@@ -6787,12 +6778,12 @@ ppc_frob_section (asection *sec)
   static bfd_vma vma = 0;
 
   /* Dwarf sections start at 0.  */
-  if (bfd_get_section_flags (NULL, sec) & SEC_DEBUGGING)
+  if (bfd_section_flags (sec) & SEC_DEBUGGING)
     return;
 
   vma = md_section_align (sec, vma);
-  bfd_set_section_vma (stdoutput, sec, vma);
-  vma += bfd_section_size (stdoutput, sec);
+  bfd_set_section_vma (sec, vma);
+  vma += bfd_section_size (sec);
 }
 
 #endif /* OBJ_XCOFF */
@@ -6823,7 +6814,7 @@ md_section_align (asection *seg ATTRIBUTE_UNUSED, valueT addr)
 #ifdef OBJ_ELF
   return addr;
 #else
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
 
   return ((addr + (1 << align) - 1) & -(1 << align));
 #endif
@@ -6886,7 +6877,7 @@ ppc_fix_adjustable (fixS *fix)
     return 0;
 
   /* Always adjust symbols in debugging sections.  */
-  if (bfd_get_section_flags (stdoutput, symseg) & SEC_DEBUGGING)
+  if (bfd_section_flags (symseg) & SEC_DEBUGGING)
     return 1;
 
   if (ppc_toc_csect != (symbolS *) NULL
@@ -7927,9 +7918,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
 #else
       /* We want to use the offset within the toc, not the actual VMA
         of the symbol.  */
-      fixP->fx_addnumber =
-       - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP->fx_addsy))
-       - S_GET_VALUE (ppc_toc_csect);
+      fixP->fx_addnumber = (- bfd_section_vma (S_GET_SEGMENT (fixP->fx_addsy))
+                           - S_GET_VALUE (ppc_toc_csect));
       /* Set *valP to avoid errors.  */
       *valP = value;
 #endif
index 12ed8cc834e79ce774793063d5d5746f22540ab4..2e2058c1debb81adf60dd9ddba744caee1d4577e 100644 (file)
@@ -1745,7 +1745,7 @@ md_assemble (char *op_str)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & (-((valueT) 1 << align)));
 }
 
index 878c03f97e853bd0841372094e4800928b4406ba..9160cc027fb077118e666d344f57d3e8fa150928 100644 (file)
@@ -1520,6 +1520,6 @@ md_apply_fix (struct fix * f ATTRIBUTE_UNUSED,
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index 6b19f2f397152860d8423fb80fce7f1453060f1e..5d2e69b8b30a803851e91dcc186819e7a2a299d9 100644 (file)
@@ -509,7 +509,7 @@ parse_rx_section (char * name)
       obj_elf_change_section (name, type, 0, attr, 0, NULL, FALSE, FALSE);
     }
 
-  bfd_set_section_alignment (stdoutput, now_seg, align);
+  bfd_set_section_alignment (now_seg, align);
 }
 
 static void
@@ -1290,7 +1290,7 @@ md_operand (expressionS * exp ATTRIBUTE_UNUSED)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
index 67e88d277a8babc0f0e46262e67ad544db2bd35d..be4d4fb0952e40f7ad5ab82d1a77d8dc27a2c12b 100644 (file)
@@ -187,7 +187,7 @@ md_atof (int type, char *litP, int *sizeP)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
index f74497aa85573caa91c0c0aacb71ded6bb6e3cd6..a4dae4fb16d67501fc57977875ea2a66b9ef95ff 100644 (file)
@@ -2084,7 +2084,7 @@ md_atof (int type, char *litp, int *sizep)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
 
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
index 648e0d22ebb1244c59d2e9d9289916c03d3b325d..1393a188206ad34616e930b6395f3c06c2b24875 100644 (file)
@@ -5300,7 +5300,7 @@ s3_pic_need_relax (symbolS *sym, asection *segtype)
   linkonce = FALSE;
   if (symsec != segtype && ! S_IS_LOCAL (sym))
     {
-      if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0)
+      if ((bfd_section_flags (symsec) & SEC_LINK_ONCE) != 0)
        linkonce = TRUE;
 
       /* The GNU toolchain uses an extension for ELF: a section
@@ -5546,7 +5546,7 @@ static void
 s3_score_s_section (int ignore)
 {
   obj_elf_section (ignore);
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     record_alignment (now_seg, 2);
 
 }
@@ -5569,14 +5569,14 @@ s3_s_change_sec (int sec)
     {
     case 'r':
       seg = subseg_new (s3_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ());
-      bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
+      bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
       if (strcmp (TARGET_OS, "elf") != 0)
         record_alignment (seg, 4);
       demand_empty_rest_of_line ();
       break;
     case 's':
       seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
-      bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
+      bfd_set_section_flags (seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
       if (strcmp (TARGET_OS, "elf") != 0)
         record_alignment (seg, 4);
       demand_empty_rest_of_line ();
@@ -5686,7 +5686,7 @@ s3_s_score_ent (int aent)
     s3_get_number ();
 
 #ifdef BFD_ASSEMBLER
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     maybe_text = 1;
   else
     maybe_text = 0;
@@ -5795,7 +5795,7 @@ s3_s_score_end (int x ATTRIBUTE_UNUSED)
     p = NULL;
 
 #ifdef BFD_ASSEMBLER
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     maybe_text = 1;
   else
     maybe_text = 0;
@@ -6128,15 +6128,16 @@ s3_s_score_lcomm (int bytes_p)
   if (OUTPUT_FLAVOR == bfd_target_ecoff_flavour || OUTPUT_FLAVOR == bfd_target_elf_flavour)
     {
       /* For Score and Alpha ECOFF or ELF, small objects are put in .sbss.  */
-      if ((unsigned)temp <= bfd_get_gp_size (stdoutput))
-        {
-          bss_seg = subseg_new (".sbss", 1);
-          seg_info (bss_seg)->bss = 1;
+      if ((unsigned) temp <= bfd_get_gp_size (stdoutput))
+       {
+         bss_seg = subseg_new (".sbss", 1);
+         seg_info (bss_seg)->bss = 1;
 #ifdef BFD_ASSEMBLER
-          if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
-            as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ()));
+         if (!bfd_set_section_flags (bss_seg, SEC_ALLOC))
+           as_warn (_("error setting flags for \".sbss\": %s"),
+                    bfd_errmsg (bfd_get_error ()));
 #endif
-        }
+       }
     }
 #endif
 
@@ -6538,8 +6539,8 @@ s3_begin (void)
   seg = now_seg;
   subseg = now_subseg;
   s3_pdr_seg = subseg_new (".pdr", (subsegT) 0);
-  (void)bfd_set_section_flags (stdoutput, s3_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
-  (void)bfd_set_section_alignment (stdoutput, s3_pdr_seg, 2);
+  bfd_set_section_flags (s3_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
+  bfd_set_section_alignment (s3_pdr_seg, 2);
   subseg_set (seg, subseg);
 
   if (s3_USE_GLOBAL_POINTER_OPT)
@@ -7076,7 +7077,7 @@ s3_pcrel_from (fixS * fixP)
 static valueT
 s3_section_align (segT segment ATTRIBUTE_UNUSED, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
index 90cd5e3962d8f27ed2b5b81d55017d6cb7191459..a615e149c9d1d72b9cd48c4f6f4f5b554cbda289 100644 (file)
@@ -5188,7 +5188,7 @@ s7_pic_need_relax (symbolS *sym, asection *segtype)
   linkonce = FALSE;
   if (symsec != segtype && ! S_IS_LOCAL (sym))
     {
-      if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0)
+      if ((bfd_section_flags (symsec) & SEC_LINK_ONCE) != 0)
        linkonce = TRUE;
 
       /* The GNU toolchain uses an extension for ELF: a section
@@ -5399,7 +5399,7 @@ static void
 s7_s_section (int ignore)
 {
   obj_elf_section (ignore);
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     record_alignment (now_seg, 2);
 
 }
@@ -5422,14 +5422,14 @@ s7_s_change_sec (int sec)
     {
     case 'r':
       seg = subseg_new (s7_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ());
-      bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
+      bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
       if (strcmp (TARGET_OS, "elf") != 0)
         record_alignment (seg, 4);
       demand_empty_rest_of_line ();
       break;
     case 's':
       seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
-      bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
+      bfd_set_section_flags (seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
       if (strcmp (TARGET_OS, "elf") != 0)
         record_alignment (seg, 4);
       demand_empty_rest_of_line ();
@@ -5540,7 +5540,7 @@ s7_s_score_ent (int aent)
     s7_get_number ();
 
 #ifdef BFD_ASSEMBLER
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     maybe_text = 1;
   else
     maybe_text = 0;
@@ -5650,7 +5650,7 @@ s7_s_score_end (int x ATTRIBUTE_UNUSED)
     p = NULL;
 
 #ifdef BFD_ASSEMBLER
-  if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+  if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
     maybe_text = 1;
   else
     maybe_text = 0;
@@ -5993,7 +5993,7 @@ s7_s_score_lcomm (int bytes_p)
           bss_seg = subseg_new (".sbss", 1);
           seg_info (bss_seg)->bss = 1;
 #ifdef BFD_ASSEMBLER
-          if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
+          if (!bfd_set_section_flags (bss_seg, SEC_ALLOC))
             as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ()));
 #endif
         }
@@ -6152,8 +6152,8 @@ s7_begin (void)
   seg = now_seg;
   subseg = now_subseg;
   s7_pdr_seg = subseg_new (".pdr", (subsegT) 0);
-  (void) bfd_set_section_flags (stdoutput, s7_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
-  (void) bfd_set_section_alignment (stdoutput, s7_pdr_seg, 2);
+  bfd_set_section_flags (s7_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
+  bfd_set_section_alignment (s7_pdr_seg, 2);
   subseg_set (seg, subseg);
 
   if (s7_USE_GLOBAL_POINTER_OPT)
@@ -6628,7 +6628,7 @@ s7_pcrel_from (fixS * fixP)
 static valueT
 s7_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index c9d47df9f6e9be777911ac43fd2a27d0f5f4b6b9..c57f0661344baeee6b1efd3bbf78e663c908a072 100644 (file)
@@ -3162,8 +3162,8 @@ md_section_align (segT seg ATTRIBUTE_UNUSED, valueT size)
 #ifdef OBJ_ELF
   return size;
 #else /* ! OBJ_ELF */
-  return ((size + (1 << bfd_get_section_alignment (stdoutput, seg)) - 1)
-         & -(1 << bfd_get_section_alignment (stdoutput, seg)));
+  return ((size + (1 << bfd_section_alignment (seg)) - 1)
+         & -(1 << bfd_section_alignment (seg)));
 #endif /* ! OBJ_ELF */
 }
 
index 347db08173a8948ef1ecb970dbf36267ff8905ef..4f7d675f60c74ce8eccaf7190ebcb39b76b97e9f 100644 (file)
@@ -4001,7 +4001,7 @@ tc_gen_reloc (asection *section, fixS *fixp)
     }
 
   /* Nothing is aligned in DWARF debugging sections.  */
-  if (bfd_get_section_flags (stdoutput, section) & SEC_DEBUGGING)
+  if (bfd_section_flags (section) & SEC_DEBUGGING)
     switch (code)
       {
       case BFD_RELOC_16: code = BFD_RELOC_SPARC_UA16; break;
index d3e3d8aebc3a719750a3098b13ffaaabe7ddfd8b..bdb22e72ba79c23a7d52ae74cb47fd5f6d9ebf51 100644 (file)
@@ -904,7 +904,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
 valueT
 md_section_align (segT seg, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   valueT mask = ((valueT) 1 << align) - 1;
 
   return (size + mask) & ~mask;
index f20d93b5b1607b069bb8f4b1896efd637fdefdcb..b5588b9c46716e3cb015f441a4e5f41d1eff808c 100644 (file)
@@ -1001,9 +1001,9 @@ tic4x_sect (int x ATTRIBUTE_UNUSED)
       symbol_set_frag (line_label, frag_now);
     }
 
-  if (bfd_get_section_flags (stdoutput, seg) == SEC_NO_FLAGS)
+  if (bfd_section_flags (seg) == SEC_NO_FLAGS)
     {
-      if (!bfd_set_section_flags (stdoutput, seg, SEC_DATA))
+      if (!bfd_set_section_flags (seg, SEC_DATA))
        as_warn (_("Error setting flags for \"%s\": %s"), name,
                 bfd_errmsg (bfd_get_error ()));
     }
@@ -1104,7 +1104,7 @@ tic4x_usect (int x ATTRIBUTE_UNUSED)
       S_SET_VALUE (line_label, frag_now_fix ());
     }
   seg_info (seg)->bss = 1;     /* Uninitialised data.  */
-  if (!bfd_set_section_flags (stdoutput, seg, SEC_ALLOC))
+  if (!bfd_set_section_flags (seg, SEC_ALLOC))
     as_warn (_("Error setting flags for \"%s\": %s"), name,
             bfd_errmsg (bfd_get_error ()));
   tic4x_seg_alloc (name, seg, size, line_label);
index 3e1d32a02e4167bfab3645938216177ff5d78e1f..72c8cf3967a24e34dcf33b59085ffcc95ff96e28 100644 (file)
@@ -1391,7 +1391,7 @@ tic54x_usect (int x ATTRIBUTE_UNUSED)
     blocking_flag = alignment_flag = 0;
 
   seg = subseg_new (name, 0);
-  flags = bfd_get_section_flags (stdoutput, seg) | SEC_ALLOC;
+  flags = bfd_section_flags (seg) | SEC_ALLOC;
 
   if (alignment_flag)
     {
@@ -1420,7 +1420,7 @@ tic54x_usect (int x ATTRIBUTE_UNUSED)
   if (blocking_flag)
     flags |= SEC_TIC54X_BLOCK;
 
-  if (!bfd_set_section_flags (stdoutput, seg, flags))
+  if (!bfd_set_section_flags (seg, flags))
     as_warn (_("Error setting flags for \"%s\": %s"), name,
             bfd_errmsg (bfd_get_error ()));
 
@@ -3977,12 +3977,12 @@ static void
 emit_insn (tic54x_insn *insn)
 {
   int i;
-  flagword oldflags = bfd_get_section_flags (stdoutput, now_seg);
+  flagword oldflags = bfd_section_flags (now_seg);
   flagword flags = oldflags | SEC_CODE;
 
-  if (! bfd_set_section_flags (stdoutput, now_seg, flags))
+  if (!bfd_set_section_flags (now_seg, flags))
         as_warn (_("error setting flags for \"%s\": %s"),
-                 bfd_section_name (stdoutput, now_seg),
+                 bfd_section_name (now_seg),
                  bfd_errmsg (bfd_get_error ()));
 
   for (i = 0; i < insn->words; i++)
index 108c2d42596389a8fa154ba29a4c3bf108cb091a..0433d9e409ed9724ff6675cc687309a70faa55bf 100644 (file)
@@ -781,7 +781,7 @@ md_begin (void)
 
   /* This is copied from perform_an_assembly_pass.  */
   applicable = bfd_applicable_section_flags (stdoutput);
-  bfd_set_section_flags (stdoutput, sbss_section, applicable & SEC_ALLOC);
+  bfd_set_section_flags (sbss_section, applicable & SEC_ALLOC);
 
   subseg_set (seg, subseg);
 
@@ -4483,7 +4483,7 @@ md_section_align (segT segment ATTRIBUTE_UNUSED,
 {
   /* Round up section sizes to ensure that text sections consist of
      whole fetch packets.  */
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
 }
 
index e840e5dc85f75a422251cd7e424546f9daff2578..788a9f3b462652616f15943428d0843e7d564926 100644 (file)
@@ -262,7 +262,7 @@ md_begin (void)
     as_warn (_("Could not set architecture and machine"));
 
   /* Guarantee text section is aligned.  */
-  bfd_set_section_alignment (stdoutput, text_section,
+  bfd_set_section_alignment (text_section,
                              TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
 
   require_canonical_reg_names = 1;
@@ -948,8 +948,8 @@ tilegx_flush_bundle (void)
 
   /* If the section seems to have no alignment set yet, go ahead and
      make it large enough to hold code.  */
-  if (bfd_get_section_alignment (stdoutput, now_seg) == 0)
-    bfd_set_section_alignment (stdoutput, now_seg,
+  if (bfd_section_alignment (now_seg) == 0)
+    bfd_set_section_alignment (now_seg,
                                TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
 
   for (j = 0; j < current_bundle_index; j++)
index 146e270f7de609ae93710ba35b7fe793629eb55c..1c98a9335832c3217f30b3cbf24160e2d5daeac2 100644 (file)
@@ -207,7 +207,7 @@ md_begin (void)
   int i;
 
   /* Guarantee text section is aligned.  */
-  bfd_set_section_alignment (stdoutput, text_section,
+  bfd_set_section_alignment (text_section,
                              TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
 
   require_canonical_reg_names = 1;
@@ -838,8 +838,8 @@ tilepro_flush_bundle (void)
 
   /* If the section seems to have no alignment set yet, go ahead and
      make it large enough to hold code.  */
-  if (bfd_get_section_alignment (stdoutput, now_seg) == 0)
-    bfd_set_section_alignment (stdoutput, now_seg,
+  if (bfd_section_alignment (now_seg) == 0)
+    bfd_set_section_alignment (now_seg,
                                TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
 
   for (j = 0; j < current_bundle_index; j++)
index 12d5846487e3a117f4dbd29c1f638226c4304fd2..dfb43cbc16f3ee4ae4177eddd8fbed0fb8ccda2e 100644 (file)
@@ -229,7 +229,7 @@ do_v850_seg (int i, subsegT sub)
   else
     {
       seg->s = subseg_new (seg->name, sub);
-      bfd_set_section_flags (stdoutput, seg->s, seg->flags);
+      bfd_set_section_flags (seg->s, seg->flags);
       if ((seg->flags & SEC_LOAD) == 0)
        seg_info (seg->s)->bss = 1;
     }
@@ -1878,7 +1878,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
@@ -3740,8 +3740,8 @@ v850_md_end (void)
   enum v850_notes id;
 
   note_sec = subseg_new (V850_NOTE_SECNAME, 0);
-  bfd_set_section_flags (stdoutput, note_sec, SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
-  bfd_set_section_alignment (stdoutput, note_sec, 2);
+  bfd_set_section_flags (note_sec, SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
+  bfd_set_section_alignment (note_sec, 2);
 
   /* Provide default values for all of the notes.  */
   for (id = V850_NOTE_ALIGNMENT; id <= NUM_V850_NOTES; id++)
index 68863112301c7182cd7f427c9bf4fbdfe48646f9..fbf59c9e017e5c96d78ddc5d97b6a2d181ccfd4e 100644 (file)
@@ -222,7 +222,7 @@ visium_rdata (int xxx)
 valueT
 md_section_align (asection *seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
 
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
index c57611c5a7d79cbe4a5a3bcb2512cbed947acb52..3dc42f91df4829b5af66f5b21e2f9920f16e91cb 100644 (file)
@@ -177,7 +177,7 @@ md_begin (void)
 valueT
 md_section_align (asection * seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
index 00bdb8316eee0f114a448542b96e808481b0b649..23b9e687c864b7ee9a20369f86615781138ca80e 100644 (file)
@@ -234,7 +234,7 @@ md_atof (int type, char *litP, int *sizeP)
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
   return ((size + (1 << align) - 1) & -(1 << align));
 }
 
index b3c124398cd0cf7158551f2cf2beba69f1ab52d8..4f92c24d0dfa3539f4964b6df12b00c50cfc1195 100644 (file)
@@ -466,7 +466,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 valueT
 md_section_align (asection * seg, valueT addr)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   return ((addr + (1 << align) - 1) & -(1 << align));
 }
 
index fb874c58f9d85cf9e13e386792b4d5a6fba458f8..1c708b63625f75be673aaa36a072f0db9cf3d55f 100644 (file)
@@ -277,7 +277,7 @@ xstormy16_cgen_record_fixup_exp (fragS *              frag,
 valueT
 md_section_align (segT segment, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, segment);
+  int align = bfd_section_alignment (segment);
 
   return ((size + (1 << align) - 1) & -(1 << align));
 }
index 320e7afca50af813bf41ffd6f39f80582e2b34f9..c68128e2897c245647a90d64f210738e50e1394d 100644 (file)
@@ -4115,7 +4115,7 @@ get_is_linkonce_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec)
 {
   flagword flags, link_once_flags;
 
-  flags = bfd_get_section_flags (abfd, sec);
+  flags = bfd_section_flags (sec);
   link_once_flags = (flags & SEC_LINK_ONCE);
 
   /* Flags might not be set yet.  */
@@ -4980,7 +4980,7 @@ xtensa_mark_frags_for_org (void)
       segment_info_type *seginfo;
       fragS *fragP;
       flagword flags;
-      flags = bfd_get_section_flags (stdoutput, sec);
+      flags = bfd_section_flags (sec);
       if (flags & SEC_DEBUGGING)
        continue;
       if (!(flags & SEC_ALLOC))
@@ -5025,7 +5025,7 @@ xtensa_find_unmarked_state_frags (void)
       segment_info_type *seginfo;
       fragS *fragP;
       flagword flags;
-      flags = bfd_get_section_flags (stdoutput, sec);
+      flags = bfd_section_flags (sec);
       if (flags & SEC_DEBUGGING)
        continue;
       if (!(flags & SEC_ALLOC))
@@ -5073,7 +5073,7 @@ xtensa_find_unaligned_branch_targets (bfd *abfd ATTRIBUTE_UNUSED,
                                      asection *sec,
                                      void *unused ATTRIBUTE_UNUSED)
 {
-  flagword flags = bfd_get_section_flags (abfd, sec);
+  flagword flags = bfd_section_flags (sec);
   segment_info_type *seginfo = seg_info (sec);
   fragS *frag = seginfo->frchainP->frch_root;
 
@@ -5112,7 +5112,7 @@ xtensa_find_unaligned_loops (bfd *abfd ATTRIBUTE_UNUSED,
                             asection *sec,
                             void *unused ATTRIBUTE_UNUSED)
 {
-  flagword flags = bfd_get_section_flags (abfd, sec);
+  flagword flags = bfd_section_flags (sec);
   segment_info_type *seginfo = seg_info (sec);
   fragS *frag = seginfo->frchainP->frch_root;
   xtensa_isa isa = xtensa_default_isa;
@@ -8941,7 +8941,7 @@ xtensa_add_config_info (void)
   int sz;
 
   info_sec = subseg_new (".xtensa.info", 0);
-  bfd_set_section_flags (stdoutput, info_sec, SEC_HAS_CONTENTS | SEC_READONLY);
+  bfd_set_section_flags (info_sec, SEC_HAS_CONTENTS | SEC_READONLY);
 
   data = XNEWVEC (char, 100);
   sprintf (data, "USE_ABSOLUTE_LITERALS=%d\nABI=%d\n",
@@ -11682,8 +11682,8 @@ cache_literal_section (bfd_boolean use_abs_literals)
 
       elf_group_name (seg) = group_name;
 
-      bfd_set_section_flags (stdoutput, seg, flags);
-      bfd_set_section_alignment (stdoutput, seg, 2);
+      bfd_set_section_flags (seg, flags);
+      bfd_set_section_alignment (seg, 2);
     }
 
   *pcached = seg;
@@ -11814,7 +11814,7 @@ xtensa_create_property_segments (frag_predicate property_function,
            num_recs++;
 
          rec_size = num_recs * 8;
-         bfd_set_section_size (stdoutput, sec, rec_size);
+         bfd_set_section_size (sec, rec_size);
 
          if (num_recs)
            {
@@ -11911,7 +11911,7 @@ xtensa_create_xproperty_segments (frag_flags_fn flag_fn,
            num_recs++;
 
          rec_size = num_recs * (8 + 4);
-         bfd_set_section_size (stdoutput, sec, rec_size);
+         bfd_set_section_size (sec, rec_size);
          /* elf_section_data (sec)->this_hdr.sh_entsize = 12; */
 
          if (num_recs)
@@ -11955,7 +11955,7 @@ xtensa_create_xproperty_segments (frag_flags_fn flag_fn,
 static bfd_boolean
 exclude_section_from_property_tables (segT sec)
 {
-  flagword flags = bfd_get_section_flags (stdoutput, sec);
+  flagword flags = bfd_section_flags (sec);
 
   /* Sections that don't contribute to the memory footprint are excluded.  */
   if ((flags & SEC_DEBUGGING)
index 9cb41a3cc9b2c61885833e9599bef7f7b712b23d..68e1b761cd646b31aed30908b40a15d851a718e8 100644 (file)
@@ -1385,7 +1385,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
 valueT
 md_section_align (segT seg, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   valueT mask = ((valueT) 1 << align) - 1;
 
   return (size + mask) & ~mask;
index f30734d384b0f1b94d29dd0c5b587afbfbcb509f..388123fd2410f64546df069cf1cf0bb424fd3a8d 100644 (file)
@@ -232,7 +232,7 @@ get_debugseg_name (segT seg, const char *base_name)
   if (!seg)
     return concat (base_name, NULL);
 
-  name = bfd_get_section_name (stdoutput, seg);
+  name = bfd_section_name (seg);
 
   if (name == NULL || *name == 0)
     return concat (base_name, NULL);
@@ -281,7 +281,7 @@ is_now_linkonce_segment (void)
   if (compact_eh)
     return now_seg;
 
-  if ((bfd_get_section_flags (stdoutput, now_seg)
+  if ((bfd_section_flags (now_seg)
        & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
          | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
          | SEC_LINK_DUPLICATES_SAME_CONTENTS)) != 0)
@@ -306,16 +306,16 @@ make_debug_seg (segT cseg, char *name, int sflags)
   if (!cseg)
     flags = 0;
   else
-    flags = bfd_get_section_flags (stdoutput, cseg)
-      & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
-        | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
-        | SEC_LINK_DUPLICATES_SAME_CONTENTS);
+    flags = (bfd_section_flags (cseg)
+            & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
+               | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
+               | SEC_LINK_DUPLICATES_SAME_CONTENTS));
 
   /* Add standard section flags.  */
   flags |= sflags;
 
   /* Apply possibly linked once flags to new generated segment, too.  */
-  if (!bfd_set_section_flags (stdoutput, r, flags))
+  if (!bfd_set_section_flags (r, flags))
     as_bad (_("bfd_set_section_flags: %s"),
            bfd_errmsg (bfd_get_error ()));
 
@@ -1359,7 +1359,7 @@ get_cfi_seg (segT cseg, const char *base, flagword flags, int align)
   else
     {
       cseg = subseg_new (base, 0);
-      bfd_set_section_flags (stdoutput, cseg, flags);
+      bfd_set_section_flags (cseg, flags);
     }
   record_alignment (cseg, align);
   return cseg;
index 5f804f15413283bc7877b35198adf0b7aeed2e66..90b47b02fc049a9655c5057439b98de82ef5b192 100644 (file)
@@ -657,7 +657,7 @@ dwarf2_emit_label (symbolS *label)
     return;
   if (S_GET_SEGMENT (label) != now_seg)
     return;
-  if (!(bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE))
+  if (!(bfd_section_flags (now_seg) & SEC_CODE))
     return;
   if (files_in_use == 0 && debug_type != DEBUG_DWARF2)
     return;
@@ -1594,7 +1594,7 @@ process_entries (segT seg, struct line_entry *e)
         that all of the sub-sections are merged into a proper
         .debug_line section before a debugger sees them.  */
 
-      sec_name = bfd_get_section_name (stdoutput, seg);
+      sec_name = bfd_section_name (seg);
       if (strcmp (sec_name, ".text") != 0)
        {
          name = concat (".debug_line", sec_name, (char *) NULL);
@@ -2238,7 +2238,7 @@ dwarf2_finish (void)
 
   /* Create and switch to the line number section.  */
   line_seg = subseg_new (".debug_line", 0);
-  bfd_set_section_flags (stdoutput, line_seg, SEC_READONLY | SEC_DEBUGGING);
+  bfd_set_section_flags (line_seg, SEC_READONLY | SEC_DEBUGGING);
 
   /* For each subsection, chain the debug entries together.  */
   for (s = all_segs; s; s = s->next)
@@ -2284,15 +2284,11 @@ dwarf2_finish (void)
       aranges_seg = subseg_new (".debug_aranges", 0);
       str_seg = subseg_new (".debug_str", 0);
 
-      bfd_set_section_flags (stdoutput, info_seg,
-                            SEC_READONLY | SEC_DEBUGGING);
-      bfd_set_section_flags (stdoutput, abbrev_seg,
-                            SEC_READONLY | SEC_DEBUGGING);
-      bfd_set_section_flags (stdoutput, aranges_seg,
-                            SEC_READONLY | SEC_DEBUGGING);
-      bfd_set_section_flags (stdoutput, str_seg,
-                            (SEC_READONLY | SEC_DEBUGGING
-                             | SEC_MERGE | SEC_STRINGS));
+      bfd_set_section_flags (info_seg, SEC_READONLY | SEC_DEBUGGING);
+      bfd_set_section_flags (abbrev_seg, SEC_READONLY | SEC_DEBUGGING);
+      bfd_set_section_flags (aranges_seg, SEC_READONLY | SEC_DEBUGGING);
+      bfd_set_section_flags (str_seg, (SEC_READONLY | SEC_DEBUGGING
+                                      | SEC_MERGE | SEC_STRINGS));
       str_seg->entsize = 1;
 
       record_alignment (aranges_seg, ffs (2 * sizeof_address) - 1);
@@ -2302,8 +2298,7 @@ dwarf2_finish (void)
       else
        {
          ranges_seg = subseg_new (".debug_ranges", 0);
-         bfd_set_section_flags (stdoutput, ranges_seg,
-                                SEC_READONLY | SEC_DEBUGGING);
+         bfd_set_section_flags (ranges_seg, SEC_READONLY | SEC_DEBUGGING);
          record_alignment (ranges_seg, ffs (2 * sizeof_address) - 1);
          out_debug_ranges (ranges_seg);
        }
index 09e8f0e6cf3873e5492f300ed538757c6b81edc7..bacc89fe3af6e8611f39fea88f229c6b4e0878f7 100644 (file)
@@ -3700,8 +3700,7 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend,
       && first_proc_ptr != (proc_t *) NULL
       && local_first_lineno != (lineno_list_t *) NULL
       && ((S_GET_VALUE (first_proc_ptr->sym->as_sym)
-          + bfd_get_section_vma (stdoutput,
-                                 S_GET_SEGMENT (first_proc_ptr->sym->as_sym)))
+          + bfd_section_vma (S_GET_SEGMENT (first_proc_ptr->sym->as_sym)))
          != 0))
     {
       first.file = local_first_lineno->file;
@@ -3981,8 +3980,7 @@ ecoff_build_symbols (const struct ecoff_debug_swap *backend,
                      else
                        sym_ptr->ecoff_sym.asym.value =
                          (S_GET_VALUE (as_sym)
-                          + bfd_get_section_vma (stdoutput,
-                                                 S_GET_SEGMENT (as_sym))
+                          + bfd_section_vma (S_GET_SEGMENT (as_sym))
                           + sym_ptr->addend);
 
                      sym_ptr->ecoff_sym.weakext = S_IS_WEAK (as_sym);
@@ -4310,8 +4308,7 @@ ecoff_build_procs (const struct ecoff_debug_swap *backend,
 
                  adr_sym = proc_ptr->sym->as_sym;
                  adr = (S_GET_VALUE (adr_sym)
-                        + bfd_get_section_vma (stdoutput,
-                                               S_GET_SEGMENT (adr_sym)));
+                        + bfd_section_vma (S_GET_SEGMENT (adr_sym)));
                  if (first)
                    {
                      /* This code used to force the adr of the very
index 58d79b2787a15a0a528d479fd31903fb834313ce..e53dd0232d9caecd5868aab4cb1d0cfbf76b949b 100644 (file)
@@ -742,7 +742,7 @@ assemble_one (char *line)
 static bfd_boolean
 in_bss (void)
 {
-  flagword flags = bfd_get_section_flags (stdoutput, now_seg);
+  flagword flags = bfd_section_flags (now_seg);
 
   return (flags & SEC_ALLOC) && !(flags & (SEC_LOAD | SEC_HAS_CONTENTS));
 }
@@ -2419,7 +2419,7 @@ s_linkonce (int ignore ATTRIBUTE_UNUSED)
     if ((bfd_applicable_section_flags (stdoutput) & SEC_LINK_ONCE) == 0)
       as_warn (_(".linkonce is not supported for this object file format"));
 
-    flags = bfd_get_section_flags (stdoutput, now_seg);
+    flags = bfd_section_flags (now_seg);
     flags |= SEC_LINK_ONCE;
     switch (type)
       {
@@ -2438,7 +2438,7 @@ s_linkonce (int ignore ATTRIBUTE_UNUSED)
        flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS;
        break;
       }
-    if (!bfd_set_section_flags (stdoutput, now_seg, flags))
+    if (!bfd_set_section_flags (now_seg, flags))
       as_bad (_("bfd_set_section_flags: %s"),
              bfd_errmsg (bfd_get_error ()));
   }
@@ -2464,7 +2464,7 @@ bss_alloc (symbolS *symbolP, addressT size, unsigned int align)
        {
          bss_seg = subseg_new (".sbss", 1);
          seg_info (bss_seg)->bss = 1;
-         if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
+         if (!bfd_set_section_flags (bss_seg, SEC_ALLOC))
            as_warn (_("error setting flags for \".sbss\": %s"),
                     bfd_errmsg (bfd_get_error ()));
        }
@@ -2957,9 +2957,9 @@ s_mri_sect (char *type ATTRIBUTE_UNUSED)
          flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_READONLY | SEC_ROM;
        if (flags != SEC_NO_FLAGS)
          {
-           if (!bfd_set_section_flags (stdoutput, seg, flags))
+           if (!bfd_set_section_flags (seg, flags))
              as_warn (_("error setting flags for \"%s\": %s"),
-                      bfd_section_name (stdoutput, seg),
+                      bfd_section_name (seg),
                       bfd_errmsg (bfd_get_error ()));
          }
       }
index 64811c1bb15bb3e17ae3b624734863147fea765a..0217c422ec3a7715bb985f508abda5c5af46e92e 100644 (file)
@@ -109,7 +109,7 @@ get_stab_string_offset (const char *string, const char *stabstr_secname,
       p = frag_more (1);
       *p = 0;
       retval = seg_info (seg)->stabu.stab_string_size = 1;
-      bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_DEBUGGING);
+      bfd_set_section_flags (seg, SEC_READONLY | SEC_DEBUGGING);
     }
 
   if (length > 0)
@@ -336,7 +336,7 @@ s_stab_generic (int what,
 
       if (! seg_info (seg)->hadone)
        {
-         bfd_set_section_flags (stdoutput, seg,
+         bfd_set_section_flags (seg,
                                 SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
 #ifdef INIT_STAB_SECTION
          INIT_STAB_SECTION (seg);
index a66af2d3f65c60fb7ebc68ec8872270c875c6500..d438a10c696fee1511a34ed7ce96425c09744313 100644 (file)
@@ -65,7 +65,7 @@ subseg_change (segT seg, int subseg)
     {
       seginfo = XCNEW (segment_info_type);
       seginfo->bfd_section = seg;
-      bfd_set_section_userdata (stdoutput, seg, seginfo);
+      bfd_set_section_userdata (seg, seginfo);
     }
 }
 \f
@@ -146,9 +146,7 @@ subseg_get (const char *segname, int force_new)
 {
   segT secptr;
   segment_info_type *seginfo;
-  const char *now_seg_name = (now_seg
-                             ? bfd_get_section_name (stdoutput, now_seg)
-                             : 0);
+  const char *now_seg_name = now_seg ? bfd_section_name (now_seg) : 0;
 
   if (!force_new
       && now_seg_name
@@ -167,7 +165,7 @@ subseg_get (const char *segname, int force_new)
       secptr->output_section = secptr;
       seginfo = XCNEW (segment_info_type);
       seginfo->bfd_section = secptr;
-      bfd_set_section_userdata (stdoutput, secptr, seginfo);
+      bfd_set_section_userdata (secptr, seginfo);
     }
   return secptr;
 }
@@ -260,7 +258,7 @@ section_symbol (segT sec)
 int
 subseg_text_p (segT sec)
 {
-  return (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) != 0;
+  return (bfd_section_flags (sec) & SEC_CODE) != 0;
 }
 
 /* Return non zero if SEC has at least one byte of data.  It is
index d853f453aebfe18d85a08460deff9758d85e5fc5..2a956026fefe79179029485013d509d178401766 100644 (file)
@@ -112,7 +112,7 @@ typedef struct segment_info_struct {
 
 
 #define seg_info(sec) \
-  ((segment_info_type *) bfd_get_section_userdata (stdoutput, sec))
+  ((segment_info_type *) bfd_section_userdata (sec))
 
 extern symbolS *section_symbol (segT);
 
index e9a17e4468b24e55d0d9678f95eaab88ca16870d..9b5ae6ff32a3b43453bdf03da62bbb12adda569c 100644 (file)
@@ -359,8 +359,8 @@ record_alignment (/* Segment to which alignment pertains.  */
   if (seg == absolute_section)
     return;
 
-  if (align > bfd_get_section_alignment (stdoutput, seg))
-    bfd_set_section_alignment (stdoutput, seg, align);
+  if (align > bfd_section_alignment (seg))
+    bfd_set_section_alignment (seg, align);
 }
 
 int
@@ -369,7 +369,7 @@ get_recorded_alignment (segT seg)
   if (seg == absolute_section)
     return 0;
 
-  return bfd_get_section_alignment (stdoutput, seg);
+  return bfd_section_alignment (seg);
 }
 
 /* Reset the section indices after removing the gas created sections.  */
@@ -555,7 +555,7 @@ relax_seg (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *xxx)
 }
 
 static void
-size_seg (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
+size_seg (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *xxx ATTRIBUTE_UNUSED)
 {
   flagword flags;
   fragS *fragp;
@@ -580,8 +580,8 @@ size_seg (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
   else
     size = 0;
 
-  flags = bfd_get_section_flags (abfd, sec);
-  if (size == 0 && bfd_get_section_size (sec) != 0 &&
+  flags = bfd_section_flags (sec);
+  if (size == 0 && bfd_section_size (sec) != 0 &&
     (flags & SEC_HAS_CONTENTS) != 0)
     return;
 
@@ -589,7 +589,7 @@ size_seg (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
     flags |= SEC_HAS_CONTENTS;
 
   flags &= ~SEC_RELOC;
-  x = bfd_set_section_flags (abfd, sec, flags);
+  x = bfd_set_section_flags (sec, flags);
   gas_assert (x);
 
   /* If permitted, allow the backend to pad out the section
@@ -598,7 +598,7 @@ size_seg (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
     newsize = size;
   else
     newsize = md_section_align (sec, size);
-  x = bfd_set_section_size (abfd, sec, newsize);
+  x = bfd_set_section_size (sec, newsize);
   gas_assert (x);
 
   /* If the size had to be rounded up, add some padding in the last
@@ -1215,7 +1215,8 @@ get_frag_for_reloc (fragS *last_frag,
 }
 
 static void
-write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
+write_relocs (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
+             void *xxx ATTRIBUTE_UNUSED)
 {
   segment_info_type *seginfo = seg_info (sec);
   unsigned int n;
@@ -1345,9 +1346,9 @@ write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
 
   if (n)
     {
-      flagword flags = bfd_get_section_flags (abfd, sec);
+      flagword flags = bfd_section_flags (sec);
       flags |= SEC_RELOC;
-      bfd_set_section_flags (abfd, sec, flags);
+      bfd_set_section_flags (sec, flags);
       bfd_set_reloc (stdoutput, sec, relocs, n);
     }
 
@@ -1433,7 +1434,7 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
   char *header;
   struct z_stream_s *strm;
   int x;
-  flagword flags = bfd_get_section_flags (abfd, sec);
+  flagword flags = bfd_section_flags (sec);
   unsigned int header_size, compression_header_size;
 
   if (seginfo == NULL
@@ -1441,7 +1442,7 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
       || (flags & (SEC_ALLOC | SEC_HAS_CONTENTS)) == SEC_ALLOC)
     return;
 
-  section_name = bfd_get_section_name (stdoutput, sec);
+  section_name = bfd_section_name (sec);
   if (strncmp (section_name, ".debug_", 7) != 0)
     return;
 
@@ -1565,12 +1566,12 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
 
   /* Update the section size and its name.  */
   bfd_update_compression_header (abfd, (bfd_byte *) header, sec);
-  x = bfd_set_section_size (abfd, sec, compressed_size);
+  x = bfd_set_section_size (sec, compressed_size);
   gas_assert (x);
   if (!compression_header_size)
     {
       compressed_name = concat (".z", section_name + 1, (char *) NULL);
-      bfd_section_name (stdoutput, sec) = compressed_name;
+      bfd_rename_section (sec, compressed_name);
     }
 }
 
@@ -1599,7 +1600,7 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
 
   /* Write out the frags.  */
   if (seginfo == NULL
-      || !(bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS))
+      || !(bfd_section_flags (sec) & SEC_HAS_CONTENTS))
     return;
 
   for (f = seginfo->frchainP->frch_root;
@@ -1815,7 +1816,7 @@ subsegs_finish_section (asection *s)
        do_not_pad_sections_to_alignment = 1;
 
       alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
-      if ((bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE)
+      if ((bfd_section_flags (now_seg) & SEC_MERGE)
          && now_seg->entsize)
        {
          unsigned int entsize = now_seg->entsize;
@@ -1875,7 +1876,7 @@ create_obj_attrs_section (void)
   s = subseg_new (name, 0);
   elf_section_type (s)
     = get_elf_backend_data (stdoutput)->obj_attrs_section_type;
-  bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA);
+  bfd_set_section_flags (s, SEC_READONLY | SEC_DATA);
   frag_now_fix ();
   p = frag_more (size);
   bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size);
@@ -1959,9 +1960,8 @@ maybe_generate_build_notes (void)
   /* Create a GNU Build Attribute section.  */
   sec = subseg_new (GNU_BUILD_ATTRS_SECTION_NAME, FALSE);
   elf_section_type (sec) = SHT_NOTE;
-  bfd_set_section_flags (stdoutput, sec,
-                        SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA);
-  bfd_set_section_alignment (stdoutput, sec, 2);
+  bfd_set_section_flags (sec, SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA);
+  bfd_set_section_alignment (sec, 2);
 
   /* Work out the size of the notes that we will create,
      and the relocation we should use.  */
@@ -2041,7 +2041,7 @@ maybe_generate_build_notes (void)
 
        /* ...and another one to install the end address.  */
        create_note_reloc (sec, sym, total_size, desc2_offset, desc_reloc,
-                          bfd_get_section_size (bsym->section),
+                          bfd_section_size (bsym->section),
                           note);
 
        total_size += note_size;
index 47549ad0b9438fa8065290edcbbdf724356555bb..7057e37e8da8e7dae9f744d0a7ffba5388a24017 100644 (file)
@@ -1,3 +1,26 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2019-09-18  Tom Tromey  <tom@tromey.com>
 
        * NEWS: Add entry.
index 831e62fb863248e5cde9985cc8dfa91457597e3d..a375c3b137d657faf22bf9c041e84e3f07ba404f 100644 (file)
@@ -452,7 +452,7 @@ aarch64_linux_core_read_vq (struct gdbarch *gdbarch, bfd *abfd)
       return 0;
     }
 
-  size_t size = bfd_section_size (abfd, sve_section);
+  size_t size = bfd_section_size (sve_section);
 
   /* Check extended state size.  */
   if (size < SVE_HEADER_SIZE)
index 5c494c8ed2850bd615b44b165351724dd6155d81..e17550fed7727d958e594b8a6c56eb7ee2c3812c 100644 (file)
@@ -2009,12 +2009,11 @@ arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma)
   struct obj_section *osect;
 
   ALL_OBJFILE_OSECTIONS (objfile, osect)
-    if (bfd_get_section_flags (objfile->obfd,
-                              osect->the_bfd_section) & SEC_ALLOC)
+    if (bfd_section_flags (osect->the_bfd_section) & SEC_ALLOC)
       {
        bfd_vma start, size;
-       start = bfd_get_section_vma (objfile->obfd, osect->the_bfd_section);
-       size = bfd_get_section_size (osect->the_bfd_section);
+       start = bfd_section_vma (osect->the_bfd_section);
+       size = bfd_section_size (osect->the_bfd_section);
 
        if (start <= vma && vma < start + size)
          return osect;
@@ -2054,8 +2053,8 @@ arm_exidx_new_objfile (struct objfile *objfile)
   gdb::byte_vector exidx_data;
   if (exidx)
     {
-      exidx_vma = bfd_section_vma (objfile->obfd, exidx);
-      exidx_data.resize (bfd_get_section_size (exidx));
+      exidx_vma = bfd_section_vma (exidx);
+      exidx_data.resize (bfd_section_size (exidx));
 
       if (!bfd_get_section_contents (objfile->obfd, exidx,
                                     exidx_data.data (), 0,
@@ -2067,8 +2066,8 @@ arm_exidx_new_objfile (struct objfile *objfile)
   gdb::byte_vector extab_data;
   if (extab)
     {
-      extab_vma = bfd_section_vma (objfile->obfd, extab);
-      extab_data.resize (bfd_get_section_size (extab));
+      extab_vma = bfd_section_vma (extab);
+      extab_data.resize (bfd_section_size (extab));
 
       if (!bfd_get_section_contents (objfile->obfd, extab,
                                     extab_data.data (), 0,
@@ -2100,7 +2099,7 @@ arm_exidx_new_objfile (struct objfile *objfile)
       sec = arm_obj_section_from_vma (objfile, idx);
       if (sec == NULL)
        continue;
-      idx -= bfd_get_section_vma (objfile->obfd, sec->the_bfd_section);
+      idx -= bfd_section_vma (sec->the_bfd_section);
 
       /* Determine address of exception table entry.  */
       if (val == 1)
index 9798ab1a06768c95599113015d78baf7e2744002..136d53ffe137c4d7ba6f45bcbdffe44e365348c9 100644 (file)
@@ -1116,7 +1116,7 @@ auto_load_section_scripts (struct objfile *objfile, const char *section_name)
 
   scripts_sect = bfd_get_section_by_name (abfd, section_name);
   if (scripts_sect == NULL
-      || (bfd_get_section_flags (abfd, scripts_sect) & SEC_HAS_CONTENTS) == 0)
+      || (bfd_section_flags (scripts_sect) & SEC_HAS_CONTENTS) == 0)
     return;
 
   if (!bfd_get_full_section_contents (abfd, scripts_sect, &data))
@@ -1128,7 +1128,7 @@ auto_load_section_scripts (struct objfile *objfile, const char *section_name)
 
       char *p = (char *) data;
       source_section_scripts (objfile, section_name, p,
-                             p + bfd_get_section_size (scripts_sect));
+                             p + bfd_section_size (scripts_sect));
     }
 }
 
index 143d02ab88d70e35635e69c5dc170db793899fea..74e0057d4aba08ec8230051cfceea376710f7a5a 100644 (file)
@@ -163,12 +163,10 @@ dump_bfd_file (const char *filename, const char *mode,
 
   gdb_bfd_ref_ptr obfd (bfd_openw_or_error (filename, target, mode));
   osection = bfd_make_section_anyway (obfd.get (), ".newsec");
-  bfd_set_section_size (obfd.get (), osection, len);
-  bfd_set_section_vma (obfd.get (), osection, vaddr);
-  bfd_set_section_alignment (obfd.get (), osection, 0);
-  bfd_set_section_flags (obfd.get (), osection, (SEC_HAS_CONTENTS
-                                                | SEC_ALLOC
-                                                | SEC_LOAD));
+  bfd_set_section_size (osection, len);
+  bfd_set_section_vma (osection, vaddr);
+  bfd_set_section_alignment (osection, 0);
+  bfd_set_section_flags (osection, (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD));
   osection->entsize = 0;
   if (!bfd_set_section_contents (obfd.get (), osection, buf, 0, len))
     warning (_("writing dump file '%s' (%s)"), filename,
@@ -403,15 +401,15 @@ static void
 restore_section_callback (bfd *ibfd, asection *isec, void *args)
 {
   struct callback_data *data = (struct callback_data *) args;
-  bfd_vma sec_start  = bfd_section_vma (ibfd, isec);
-  bfd_size_type size = bfd_section_size (ibfd, isec);
+  bfd_vma sec_start  = bfd_section_vma (isec);
+  bfd_size_type size = bfd_section_size (isec);
   bfd_vma sec_end    = sec_start + size;
   bfd_size_type sec_offset = 0;
   bfd_size_type sec_load_count = size;
   int ret;
 
   /* Ignore non-loadable sections, eg. from elf files.  */
-  if (!(bfd_get_section_flags (ibfd, isec) & SEC_LOAD))
+  if (!(bfd_section_flags (isec) & SEC_LOAD))
     return;
 
   /* Does the section overlap with the desired restore range? */
@@ -420,7 +418,7 @@ restore_section_callback (bfd *ibfd, asection *isec, void *args)
     {
       /* No, no useable data in this section.  */
       printf_filtered (_("skipping section %s...\n"), 
-                      bfd_section_name (ibfd, isec));
+                      bfd_section_name (isec));
       return;
     }
 
@@ -441,7 +439,7 @@ restore_section_callback (bfd *ibfd, asection *isec, void *args)
           bfd_errmsg (bfd_get_error ()));
 
   printf_filtered ("Restoring section %s (0x%lx to 0x%lx)",
-                  bfd_section_name (ibfd, isec), 
+                  bfd_section_name (isec), 
                   (unsigned long) sec_start, 
                   (unsigned long) sec_end);
 
index 9f7384bc146643c7af9bce65b1a2c0258a0ce461..fe74d26cab3e66267b5327f1a6aee1d29b2d905b 100644 (file)
@@ -136,7 +136,7 @@ get_section_vmas (bfd *abfd, asection *sectp, void *context)
          bfd_get_section_vma() within memory.  Store the offset.  */
 
       sections[sectix].vma_offset
-       = bfd_get_section_vma (abfd, sectp) - sections[sectix].rva_start;
+       = bfd_section_vma (sectp) - sections[sectix].rva_start;
     }
 }
 \f
index a70461271e7284e22aed74d5c6a5a809aa0c07d2..c44b69069e4c0a2ce35dcb4b85a3edc1798fbb03 100644 (file)
@@ -222,15 +222,15 @@ coff_locate_sections (bfd *abfd, asection *sectp, void *csip)
   const char *name;
 
   csi = (struct coff_symfile_info *) csip;
-  name = bfd_get_section_name (abfd, sectp);
+  name = bfd_section_name (sectp);
   if (strcmp (name, ".text") == 0)
     {
-      csi->textaddr = bfd_section_vma (abfd, sectp);
-      csi->textsize += bfd_section_size (abfd, sectp);
+      csi->textaddr = bfd_section_vma (sectp);
+      csi->textsize += bfd_section_size (sectp);
     }
   else if (startswith (name, ".text"))
     {
-      csi->textsize += bfd_section_size (abfd, sectp);
+      csi->textsize += bfd_section_size (sectp);
     }
   else if (strcmp (name, ".stabstr") == 0)
     {
@@ -307,7 +307,7 @@ cs_section_address (struct coff_symbol *cs, bfd *abfd)
   args.resultp = &sect;
   bfd_map_over_sections (abfd, find_targ_sec, &args);
   if (sect != NULL)
-    addr = bfd_get_section_vma (abfd, sect);
+    addr = bfd_section_vma (sect);
   return addr;
 }
 
@@ -692,7 +692,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
          bfd_get_section_contents?  */
       bfd_seek (abfd, abfd->where, 0);
 
-      stabstrsize = bfd_section_size (abfd, info->stabstrsect);
+      stabstrsize = bfd_section_size (info->stabstrsect);
 
       coffstab_build_psymtabs (objfile,
                               info->textaddr, info->textsize,
index 3a765a345bf9b8b5160715d124fe34d16ad38ff8..a30c55730387951588afb07a9acb38d9762daeb5 100644 (file)
@@ -99,30 +99,30 @@ setup_sections (bfd *abfd, asection *sect, void *data_voidp)
       if (sect->output_section == NULL)
        sect->output_section = sect;
 
-      if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+      if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
        return;
 
       /* Make the memory always readable.  */
       prot = GDB_MMAP_PROT_READ;
-      if ((bfd_get_section_flags (abfd, sect) & SEC_READONLY) == 0)
+      if ((bfd_section_flags (sect) & SEC_READONLY) == 0)
        prot |= GDB_MMAP_PROT_WRITE;
-      if ((bfd_get_section_flags (abfd, sect) & SEC_CODE) != 0)
+      if ((bfd_section_flags (sect) & SEC_CODE) != 0)
        prot |= GDB_MMAP_PROT_EXEC;
 
       if (compile_debug)
        fprintf_unfiltered (gdb_stdlog,
                            "module \"%s\" section \"%s\" size %s prot %u\n",
                            bfd_get_filename (abfd),
-                           bfd_get_section_name (abfd, sect),
+                           bfd_section_name (sect),
                            paddress (target_gdbarch (),
-                                     bfd_get_section_size (sect)),
+                                     bfd_section_size (sect)),
                            prot);
     }
   else
     prot = -1;
 
   if (sect == NULL
-      || (data->last_prot != prot && bfd_get_section_size (sect) != 0))
+      || (data->last_prot != prot && bfd_section_size (sect) != 0))
     {
       CORE_ADDR addr;
       asection *sect_iter;
@@ -150,9 +150,8 @@ setup_sections (bfd *abfd, asection *sect, void *data_voidp)
 
       for (sect_iter = data->last_section_first; sect_iter != sect;
           sect_iter = sect_iter->next)
-       if ((bfd_get_section_flags (abfd, sect_iter) & SEC_ALLOC) != 0)
-         bfd_set_section_vma (abfd, sect_iter,
-                              addr + bfd_get_section_vma (abfd, sect_iter));
+       if ((bfd_section_flags (sect_iter) & SEC_ALLOC) != 0)
+         bfd_set_section_vma (sect_iter, addr + bfd_section_vma (sect_iter));
 
       data->last_size = 0;
       data->last_section_first = sect;
@@ -163,14 +162,14 @@ setup_sections (bfd *abfd, asection *sect, void *data_voidp)
   if (sect == NULL)
     return;
 
-  alignment = ((CORE_ADDR) 1) << bfd_get_section_alignment (abfd, sect);
+  alignment = ((CORE_ADDR) 1) << bfd_section_alignment (sect);
   data->last_max_alignment = std::max (data->last_max_alignment, alignment);
 
   data->last_size = (data->last_size + alignment - 1) & -alignment;
 
-  bfd_set_section_vma (abfd, sect, data->last_size);
+  bfd_set_section_vma (sect, data->last_size);
 
-  data->last_size += bfd_get_section_size (sect);
+  data->last_size += bfd_section_size (sect);
   data->last_size = (data->last_size + alignment - 1) & -alignment;
 }
 
@@ -197,7 +196,7 @@ link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning,
                        bfd_vma address)
 {
   warning (_("Compiled module \"%s\" section \"%s\": warning: %s"),
-          bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
+          bfd_get_filename (abfd), bfd_section_name (section),
           xwarning);
 }
 
@@ -210,7 +209,7 @@ link_callbacks_undefined_symbol (struct bfd_link_info *link_info,
 {
   warning (_("Cannot resolve relocation to \"%s\" "
             "from compiled module \"%s\" section \"%s\"."),
-          name, bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
+          name, bfd_get_filename (abfd), bfd_section_name (section));
 }
 
 /* Helper for link_callbacks callbacks vector.  */
@@ -233,7 +232,7 @@ link_callbacks_reloc_dangerous (struct bfd_link_info *link_info,
 {
   warning (_("Compiled module \"%s\" section \"%s\": dangerous "
             "relocation: %s\n"),
-          bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
+          bfd_get_filename (abfd), bfd_section_name (section),
           message);
 }
 
@@ -246,7 +245,7 @@ link_callbacks_unattached_reloc (struct bfd_link_info *link_info,
 {
   warning (_("Compiled module \"%s\" section \"%s\": unattached "
             "relocation: %s\n"),
-          bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
+          bfd_get_filename (abfd), bfd_section_name (section),
           name);
 }
 
@@ -324,11 +323,11 @@ copy_sections (bfd *abfd, asection *sect, void *data)
   struct bfd_link_order link_order;
   CORE_ADDR inferior_addr;
 
-  if ((bfd_get_section_flags (abfd, sect) & (SEC_ALLOC | SEC_LOAD))
+  if ((bfd_section_flags (sect) & (SEC_ALLOC | SEC_LOAD))
       != (SEC_ALLOC | SEC_LOAD))
     return;
 
-  if (bfd_get_section_size (sect) == 0)
+  if (bfd_section_size (sect) == 0)
     return;
 
   /* Mostly a copy of bfd_simple_get_relocated_section_contents which GDB
@@ -349,11 +348,11 @@ copy_sections (bfd *abfd, asection *sect, void *data)
   link_order.next = NULL;
   link_order.type = bfd_indirect_link_order;
   link_order.offset = 0;
-  link_order.size = bfd_get_section_size (sect);
+  link_order.size = bfd_section_size (sect);
   link_order.u.indirect.section = sect;
 
   gdb::unique_xmalloc_ptr<gdb_byte> sect_data
-    ((bfd_byte *) xmalloc (bfd_get_section_size (sect)));
+    ((bfd_byte *) xmalloc (bfd_section_size (sect)));
 
   sect_data_got = bfd_get_relocated_section_contents (abfd, &link_info,
                                                      &link_order,
@@ -362,19 +361,19 @@ copy_sections (bfd *abfd, asection *sect, void *data)
 
   if (sect_data_got == NULL)
     error (_("Cannot map compiled module \"%s\" section \"%s\": %s"),
-          bfd_get_filename (abfd), bfd_get_section_name (abfd, sect),
+          bfd_get_filename (abfd), bfd_section_name (sect),
           bfd_errmsg (bfd_get_error ()));
   gdb_assert (sect_data_got == sect_data.get ());
 
-  inferior_addr = bfd_get_section_vma (abfd, sect);
+  inferior_addr = bfd_section_vma (sect);
   if (0 != target_write_memory (inferior_addr, sect_data.get (),
-                               bfd_get_section_size (sect)))
+                               bfd_section_size (sect)))
     error (_("Cannot write compiled module \"%s\" section \"%s\" "
             "to inferior memory range %s-%s."),
-          bfd_get_filename (abfd), bfd_get_section_name (abfd, sect),
+          bfd_get_filename (abfd), bfd_section_name (sect),
           paddress (target_gdbarch (), inferior_addr),
           paddress (target_gdbarch (),
-                    inferior_addr + bfd_get_section_size (sect)));
+                    inferior_addr + bfd_section_size (sect)));
 }
 
 /* Fetch the type of COMPILE_I_EXPR_PTR_TYPE and COMPILE_I_EXPR_VAL
index 5e9634e9d79195760cb816caf1de5903777ccfca..b30b91b522d94f048e1e741a6d4c0bb570ed58e4 100644 (file)
@@ -289,10 +289,10 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
   bool fake_pid_p = false;
   struct inferior *inf;
 
-  if (!startswith (bfd_section_name (abfd, asect), ".reg/"))
+  if (!startswith (bfd_section_name (asect), ".reg/"))
     return;
 
-  core_tid = atoi (bfd_section_name (abfd, asect) + 5);
+  core_tid = atoi (bfd_section_name (asect) + 5);
 
   pid = bfd_core_file_pid (core_bfd);
   if (pid == 0)
@@ -584,7 +584,7 @@ core_target::get_core_register_section (struct regcache *regcache,
       return;
     }
 
-  size = bfd_section_size (core_bfd, section);
+  size = bfd_section_size (section);
   if (size < section_min_size)
     {
       warning (_("Section `%s' in core file too small."),
@@ -614,8 +614,7 @@ core_target::get_core_register_section (struct regcache *regcache,
 
   gdb_assert (m_core_vec != nullptr);
   m_core_vec->core_read_registers (regcache, contents, size, which,
-                                  ((CORE_ADDR)
-                                   bfd_section_vma (core_bfd, section)));
+                                  (CORE_ADDR) bfd_section_vma (section));
 }
 
 /* Data passed to gdbarch_iterate_over_regset_sections's callback.  */
@@ -727,7 +726,7 @@ add_to_spuid_list (bfd *abfd, asection *asect, void *list_p)
     = bfd_big_endian (abfd) ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
   int fd, pos = 0;
 
-  sscanf (bfd_section_name (abfd, asect), "SPU/%d/regs%n", &fd, &pos);
+  sscanf (bfd_section_name (asect), "SPU/%d/regs%n", &fd, &pos);
   if (pos == 0)
     return;
 
@@ -768,7 +767,7 @@ core_target::xfer_partial (enum target_object object, const char *annex,
          if (section == NULL)
            return TARGET_XFER_E_IO;
 
-         size = bfd_section_size (core_bfd, section);
+         size = bfd_section_size (section);
          if (offset >= size)
            return TARGET_XFER_EOF;
          size -= offset;
@@ -803,7 +802,7 @@ core_target::xfer_partial (enum target_object object, const char *annex,
          if (section == NULL)
            return TARGET_XFER_E_IO;
 
-         size = bfd_section_size (core_bfd, section);
+         size = bfd_section_size (section);
          if (offset >= size)
            return TARGET_XFER_EOF;
          size -= offset;
@@ -883,7 +882,7 @@ core_target::xfer_partial (enum target_object object, const char *annex,
          if (section == NULL)
            return TARGET_XFER_E_IO;
 
-         size = bfd_section_size (core_bfd, section);
+         size = bfd_section_size (section);
          if (offset >= size)
            return TARGET_XFER_EOF;
          size -= offset;
index dc0b2c727bf93782b788cc26986e7b16ea44a38f..564c5d3a414e15c2a4df33a7c594c0d7dfd39407 100644 (file)
@@ -207,10 +207,10 @@ find_text_range (bfd * sym_bfd, struct objfile *objfile)
   CORE_ADDR end = 0;
 
   for (sec = sym_bfd->sections; sec; sec = sec->next)
-    if (bfd_get_section_flags (sym_bfd, sec) & SEC_CODE)
+    if (bfd_section_flags (sec) & SEC_CODE)
       {
-       CORE_ADDR sec_start = bfd_section_vma (sym_bfd, sec);
-       CORE_ADDR sec_end = sec_start + bfd_section_size (sym_bfd, sec);
+       CORE_ADDR sec_start = bfd_section_vma (sec);
+       CORE_ADDR sec_end = sec_start + bfd_section_size (sec);
 
        if (found_any)
          {
@@ -607,8 +607,8 @@ dbx_symfile_init (struct objfile *objfile)
   text_sect = bfd_get_section_by_name (sym_bfd, ".text");
   if (!text_sect)
     error (_("Can't find .text section in symbol file"));
-  DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
-  DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
+  DBX_TEXT_ADDR (objfile) = bfd_section_vma (text_sect);
+  DBX_TEXT_SIZE (objfile) = bfd_section_size (text_sect);
 
   DBX_SYMBOL_SIZE (objfile) = obj_symbol_entry_size (sym_bfd);
   DBX_SYMCOUNT (objfile) = bfd_get_symcount (sym_bfd);
@@ -781,7 +781,7 @@ fill_symbuf (bfd *sym_bfd)
 
          if (bfd_seek (sym_bfd, filepos, SEEK_SET) != 0)
            perror_with_name (bfd_get_filename (sym_bfd));
-         symbuf_left = bfd_section_size (sym_bfd, (*symbuf_sections)[sect_idx]);
+         symbuf_left = bfd_section_size ((*symbuf_sections)[sect_idx]);
          symbol_table_offset = filepos - symbuf_read;
          ++sect_idx;
        }
@@ -2980,7 +2980,7 @@ coffstab_build_psymtabs (struct objfile *objfile,
     = make_scoped_restore (&symbuf_sections);
   if (stabsects.size () == 1)
     {
-      stabsize = bfd_section_size (sym_bfd, stabsects[0]);
+      stabsize = bfd_section_size (stabsects[0]);
       DBX_SYMCOUNT (objfile) = stabsize / DBX_SYMBOL_SIZE (objfile);
       DBX_SYMTAB_OFFSET (objfile) = stabsects[0]->filepos;
     }
@@ -2989,7 +2989,7 @@ coffstab_build_psymtabs (struct objfile *objfile,
       DBX_SYMCOUNT (objfile) = 0;
       for (asection *section : stabsects)
        {
-         stabsize = bfd_section_size (sym_bfd, section);
+         stabsize = bfd_section_size (section);
          DBX_SYMCOUNT (objfile) += stabsize / DBX_SYMBOL_SIZE (objfile);
        }
 
@@ -2997,7 +2997,7 @@ coffstab_build_psymtabs (struct objfile *objfile,
 
       sect_idx = 1;
       symbuf_sections = &stabsects;
-      symbuf_left = bfd_section_size (sym_bfd, stabsects[0]);
+      symbuf_left = bfd_section_size (stabsects[0]);
       symbuf_read = 0;
     }
 
@@ -3040,7 +3040,7 @@ elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect,
 #define        ELF_STABS_SYMBOL_SIZE   12      /* XXX FIXME XXX */
   DBX_SYMBOL_SIZE (objfile) = ELF_STABS_SYMBOL_SIZE;
   DBX_SYMCOUNT (objfile)
-    = bfd_section_size (objfile->obfd, stabsect) / DBX_SYMBOL_SIZE (objfile);
+    = bfd_section_size (stabsect) / DBX_SYMBOL_SIZE (objfile);
   DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
   DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos;
   DBX_STAB_SECTION (objfile) = stabsect;
@@ -3067,7 +3067,7 @@ elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect,
   processing_acc_compilation = 1;
 
   symbuf_read = 0;
-  symbuf_left = bfd_section_size (objfile->obfd, stabsect);
+  symbuf_left = bfd_section_size (stabsect);
 
   scoped_restore restore_stabs_data = make_scoped_restore (&stabs_data);
   gdb::unique_xmalloc_ptr<gdb_byte> data_holder;
@@ -3128,13 +3128,13 @@ stabsect_build_psymtabs (struct objfile *objfile, char *stab_name,
   text_sect = bfd_get_section_by_name (sym_bfd, text_name);
   if (!text_sect)
     error (_("Can't find %s section in symbol file"), text_name);
-  DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
-  DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
+  DBX_TEXT_ADDR (objfile) = bfd_section_vma (text_sect);
+  DBX_TEXT_SIZE (objfile) = bfd_section_size (text_sect);
 
   DBX_SYMBOL_SIZE (objfile) = sizeof (struct external_nlist);
-  DBX_SYMCOUNT (objfile) = bfd_section_size (sym_bfd, stabsect)
+  DBX_SYMCOUNT (objfile) = bfd_section_size (stabsect)
     / DBX_SYMBOL_SIZE (objfile);
-  DBX_STRINGTAB_SIZE (objfile) = bfd_section_size (sym_bfd, stabstrsect);
+  DBX_STRINGTAB_SIZE (objfile) = bfd_section_size (stabstrsect);
   DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos;     /* XXX - FIXME: POKING
                                                           INSIDE BFD DATA
                                                           STRUCTURES */
index 954428a1101fdde5543f60b07cc950685f6a37f0..3ef9114b10579ad907b4f81bb28a24ee0ed260ac 100644 (file)
@@ -70,7 +70,7 @@ dicos_load_module_p (bfd *abfd, int header_size)
   if (!section)
     return 0;
 
-  if (bfd_section_size (abfd, section) != header_size)
+  if (bfd_section_size (section) != header_size)
     return 0;
 
   /* Dicos LMs always have a "Dicos_loadModuleInfo" symbol
index e18b35e7dba09d2022336c4f01540b0a49071c42..34b8cbcb768aa77c3b7c6fbb974d57ad13c792c4 100644 (file)
@@ -1565,7 +1565,7 @@ read_encoded_value (struct comp_unit *unit, gdb_byte encoding,
       base = 0;
       break;
     case DW_EH_PE_pcrel:
-      base = bfd_get_section_vma (unit->abfd, unit->dwarf_frame_section);
+      base = bfd_section_vma (unit->dwarf_frame_section);
       base += (buf - unit->dwarf_frame_buffer);
       break;
     case DW_EH_PE_datarel:
index ea9904c416291a8f3e4bb2809e3cf230e30cd6c1..5e71ded2039abb7f9326d9dc08cb1aa40a283175 100644 (file)
@@ -2280,7 +2280,7 @@ get_section_name (const struct dwarf2_section_info *section)
   asection *sectp = get_section_bfd_section (section);
 
   gdb_assert (sectp != NULL);
-  return bfd_section_name (get_section_bfd_owner (section), sectp);
+  return bfd_section_name (sectp);
 }
 
 /* Return the name of the file SECTION is in.  */
@@ -2315,7 +2315,7 @@ get_section_flags (const struct dwarf2_section_info *section)
   asection *sectp = get_section_bfd_section (section);
 
   gdb_assert (sectp != NULL);
-  return bfd_get_section_flags (sectp->owner, sectp);
+  return bfd_section_flags (sectp);
 }
 
 /* When loading sections, we look either for uncompressed section or for
@@ -2340,7 +2340,7 @@ void
 dwarf2_per_objfile::locate_sections (bfd *abfd, asection *sectp,
                                     const dwarf2_debug_sections &names)
 {
-  flagword aflag = bfd_get_section_flags (abfd, sectp);
+  flagword aflag = bfd_section_flags (sectp);
 
   if ((aflag & SEC_HAS_CONTENTS) == 0)
     {
@@ -2348,72 +2348,72 @@ dwarf2_per_objfile::locate_sections (bfd *abfd, asection *sectp,
   else if (section_is_p (sectp->name, &names.info))
     {
       this->info.s.section = sectp;
-      this->info.size = bfd_get_section_size (sectp);
+      this->info.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.abbrev))
     {
       this->abbrev.s.section = sectp;
-      this->abbrev.size = bfd_get_section_size (sectp);
+      this->abbrev.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.line))
     {
       this->line.s.section = sectp;
-      this->line.size = bfd_get_section_size (sectp);
+      this->line.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.loc))
     {
       this->loc.s.section = sectp;
-      this->loc.size = bfd_get_section_size (sectp);
+      this->loc.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.loclists))
     {
       this->loclists.s.section = sectp;
-      this->loclists.size = bfd_get_section_size (sectp);
+      this->loclists.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.macinfo))
     {
       this->macinfo.s.section = sectp;
-      this->macinfo.size = bfd_get_section_size (sectp);
+      this->macinfo.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.macro))
     {
       this->macro.s.section = sectp;
-      this->macro.size = bfd_get_section_size (sectp);
+      this->macro.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.str))
     {
       this->str.s.section = sectp;
-      this->str.size = bfd_get_section_size (sectp);
+      this->str.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.line_str))
     {
       this->line_str.s.section = sectp;
-      this->line_str.size = bfd_get_section_size (sectp);
+      this->line_str.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.addr))
     {
       this->addr.s.section = sectp;
-      this->addr.size = bfd_get_section_size (sectp);
+      this->addr.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.frame))
     {
       this->frame.s.section = sectp;
-      this->frame.size = bfd_get_section_size (sectp);
+      this->frame.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.eh_frame))
     {
       this->eh_frame.s.section = sectp;
-      this->eh_frame.size = bfd_get_section_size (sectp);
+      this->eh_frame.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.ranges))
     {
       this->ranges.s.section = sectp;
-      this->ranges.size = bfd_get_section_size (sectp);
+      this->ranges.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.rnglists))
     {
       this->rnglists.s.section = sectp;
-      this->rnglists.size = bfd_get_section_size (sectp);
+      this->rnglists.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.types))
     {
@@ -2421,28 +2421,28 @@ dwarf2_per_objfile::locate_sections (bfd *abfd, asection *sectp,
 
       memset (&type_section, 0, sizeof (type_section));
       type_section.s.section = sectp;
-      type_section.size = bfd_get_section_size (sectp);
+      type_section.size = bfd_section_size (sectp);
 
       this->types.push_back (type_section);
     }
   else if (section_is_p (sectp->name, &names.gdb_index))
     {
       this->gdb_index.s.section = sectp;
-      this->gdb_index.size = bfd_get_section_size (sectp);
+      this->gdb_index.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.debug_names))
     {
       this->debug_names.s.section = sectp;
-      this->debug_names.size = bfd_get_section_size (sectp);
+      this->debug_names.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names.debug_aranges))
     {
       this->debug_aranges.s.section = sectp;
-      this->debug_aranges.size = bfd_get_section_size (sectp);
+      this->debug_aranges.size = bfd_section_size (sectp);
     }
 
-  if ((bfd_get_section_flags (abfd, sectp) & (SEC_LOAD | SEC_ALLOC))
-      && bfd_section_vma (abfd, sectp) == 0)
+  if ((bfd_section_flags (sectp) & (SEC_LOAD | SEC_ALLOC))
+      && bfd_section_vma (sectp) == 0)
     this->has_section_at_zero = true;
 }
 
@@ -2531,7 +2531,7 @@ dwarf2_read_section (struct objfile *objfile, dwarf2_section_info *info)
     {
       error (_("Dwarf Error: Can't read DWARF data"
               " in section %s [in module %s]"),
-            bfd_section_name (abfd, sectp), bfd_get_filename (abfd));
+            bfd_section_name (sectp), bfd_get_filename (abfd));
     }
 }
 
@@ -2603,37 +2603,37 @@ locate_dwz_sections (bfd *abfd, asection *sectp, void *arg)
   if (section_is_p (sectp->name, &dwarf2_elf_names.abbrev))
     {
       dwz_file->abbrev.s.section = sectp;
-      dwz_file->abbrev.size = bfd_get_section_size (sectp);
+      dwz_file->abbrev.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &dwarf2_elf_names.info))
     {
       dwz_file->info.s.section = sectp;
-      dwz_file->info.size = bfd_get_section_size (sectp);
+      dwz_file->info.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &dwarf2_elf_names.str))
     {
       dwz_file->str.s.section = sectp;
-      dwz_file->str.size = bfd_get_section_size (sectp);
+      dwz_file->str.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &dwarf2_elf_names.line))
     {
       dwz_file->line.s.section = sectp;
-      dwz_file->line.size = bfd_get_section_size (sectp);
+      dwz_file->line.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &dwarf2_elf_names.macro))
     {
       dwz_file->macro.s.section = sectp;
-      dwz_file->macro.size = bfd_get_section_size (sectp);
+      dwz_file->macro.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &dwarf2_elf_names.gdb_index))
     {
       dwz_file->gdb_index.s.section = sectp;
-      dwz_file->gdb_index.size = bfd_get_section_size (sectp);
+      dwz_file->gdb_index.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &dwarf2_elf_names.debug_names))
     {
       dwz_file->debug_names.s.section = sectp;
-      dwz_file->debug_names.size = bfd_get_section_size (sectp);
+      dwz_file->debug_names.size = bfd_section_size (sectp);
     }
 }
 
@@ -12311,7 +12311,7 @@ locate_v1_virtual_dwo_sections (asection *sectp,
       if (sections->abbrev.s.section != NULL)
        return 0;
       sections->abbrev.s.section = sectp;
-      sections->abbrev.size = bfd_get_section_size (sectp);
+      sections->abbrev.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->info_dwo)
           || section_is_p (sectp->name, &names->types_dwo))
@@ -12320,7 +12320,7 @@ locate_v1_virtual_dwo_sections (asection *sectp,
       if (sections->info_or_types.s.section != NULL)
        return 0;
       sections->info_or_types.s.section = sectp;
-      sections->info_or_types.size = bfd_get_section_size (sectp);
+      sections->info_or_types.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->line_dwo))
     {
@@ -12328,7 +12328,7 @@ locate_v1_virtual_dwo_sections (asection *sectp,
       if (sections->line.s.section != NULL)
        return 0;
       sections->line.s.section = sectp;
-      sections->line.size = bfd_get_section_size (sectp);
+      sections->line.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->loc_dwo))
     {
@@ -12336,7 +12336,7 @@ locate_v1_virtual_dwo_sections (asection *sectp,
       if (sections->loc.s.section != NULL)
        return 0;
       sections->loc.s.section = sectp;
-      sections->loc.size = bfd_get_section_size (sectp);
+      sections->loc.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->macinfo_dwo))
     {
@@ -12344,7 +12344,7 @@ locate_v1_virtual_dwo_sections (asection *sectp,
       if (sections->macinfo.s.section != NULL)
        return 0;
       sections->macinfo.s.section = sectp;
-      sections->macinfo.size = bfd_get_section_size (sectp);
+      sections->macinfo.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->macro_dwo))
     {
@@ -12352,7 +12352,7 @@ locate_v1_virtual_dwo_sections (asection *sectp,
       if (sections->macro.s.section != NULL)
        return 0;
       sections->macro.s.section = sectp;
-      sections->macro.size = bfd_get_section_size (sectp);
+      sections->macro.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->str_offsets_dwo))
     {
@@ -12360,7 +12360,7 @@ locate_v1_virtual_dwo_sections (asection *sectp,
       if (sections->str_offsets.s.section != NULL)
        return 0;
       sections->str_offsets.s.section = sectp;
-      sections->str_offsets.size = bfd_get_section_size (sectp);
+      sections->str_offsets.size = bfd_section_size (sectp);
     }
   else
     {
@@ -12558,11 +12558,11 @@ create_dwp_v2_section (struct dwarf2_per_objfile *dwarf2_per_objfile,
      bounds of the real section.  This is a pretty-rare event, so just
      flag an error (easier) instead of a warning and trying to cope.  */
   if (sectp == NULL
-      || offset + size > bfd_get_section_size (sectp))
+      || offset + size > bfd_section_size (sectp))
     {
       error (_("Dwarf Error: Bad DWP V2 section info, doesn't fit"
               " in section %s [in module %s]"),
-            sectp ? bfd_section_name (abfd, sectp) : "<unknown>",
+            sectp ? bfd_section_name (sectp) : "<unknown>",
             objfile_name (dwarf2_per_objfile->objfile));
     }
 
@@ -12933,42 +12933,42 @@ dwarf2_locate_dwo_sections (bfd *abfd, asection *sectp, void *dwo_sections_ptr)
   if (section_is_p (sectp->name, &names->abbrev_dwo))
     {
       dwo_sections->abbrev.s.section = sectp;
-      dwo_sections->abbrev.size = bfd_get_section_size (sectp);
+      dwo_sections->abbrev.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->info_dwo))
     {
       dwo_sections->info.s.section = sectp;
-      dwo_sections->info.size = bfd_get_section_size (sectp);
+      dwo_sections->info.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->line_dwo))
     {
       dwo_sections->line.s.section = sectp;
-      dwo_sections->line.size = bfd_get_section_size (sectp);
+      dwo_sections->line.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->loc_dwo))
     {
       dwo_sections->loc.s.section = sectp;
-      dwo_sections->loc.size = bfd_get_section_size (sectp);
+      dwo_sections->loc.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->macinfo_dwo))
     {
       dwo_sections->macinfo.s.section = sectp;
-      dwo_sections->macinfo.size = bfd_get_section_size (sectp);
+      dwo_sections->macinfo.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->macro_dwo))
     {
       dwo_sections->macro.s.section = sectp;
-      dwo_sections->macro.size = bfd_get_section_size (sectp);
+      dwo_sections->macro.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->str_dwo))
     {
       dwo_sections->str.s.section = sectp;
-      dwo_sections->str.size = bfd_get_section_size (sectp);
+      dwo_sections->str.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->str_offsets_dwo))
     {
       dwo_sections->str_offsets.s.section = sectp;
-      dwo_sections->str_offsets.size = bfd_get_section_size (sectp);
+      dwo_sections->str_offsets.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->types_dwo))
     {
@@ -12976,7 +12976,7 @@ dwarf2_locate_dwo_sections (bfd *abfd, asection *sectp, void *dwo_sections_ptr)
 
       memset (&type_section, 0, sizeof (type_section));
       type_section.s.section = sectp;
-      type_section.size = bfd_get_section_size (sectp);
+      type_section.size = bfd_section_size (sectp);
       dwo_sections->types.push_back (type_section);
     }
 }
@@ -13040,17 +13040,17 @@ dwarf2_locate_common_dwp_sections (bfd *abfd, asection *sectp,
   if (section_is_p (sectp->name, &names->str_dwo))
     {
       dwp_file->sections.str.s.section = sectp;
-      dwp_file->sections.str.size = bfd_get_section_size (sectp);
+      dwp_file->sections.str.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->cu_index))
     {
       dwp_file->sections.cu_index.s.section = sectp;
-      dwp_file->sections.cu_index.size = bfd_get_section_size (sectp);
+      dwp_file->sections.cu_index.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->tu_index))
     {
       dwp_file->sections.tu_index.s.section = sectp;
-      dwp_file->sections.tu_index.size = bfd_get_section_size (sectp);
+      dwp_file->sections.tu_index.size = bfd_section_size (sectp);
     }
 }
 
@@ -13075,42 +13075,42 @@ dwarf2_locate_v2_dwp_sections (bfd *abfd, asection *sectp, void *dwp_file_ptr)
   if (section_is_p (sectp->name, &names->abbrev_dwo))
     {
       dwp_file->sections.abbrev.s.section = sectp;
-      dwp_file->sections.abbrev.size = bfd_get_section_size (sectp);
+      dwp_file->sections.abbrev.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->info_dwo))
     {
       dwp_file->sections.info.s.section = sectp;
-      dwp_file->sections.info.size = bfd_get_section_size (sectp);
+      dwp_file->sections.info.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->line_dwo))
     {
       dwp_file->sections.line.s.section = sectp;
-      dwp_file->sections.line.size = bfd_get_section_size (sectp);
+      dwp_file->sections.line.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->loc_dwo))
     {
       dwp_file->sections.loc.s.section = sectp;
-      dwp_file->sections.loc.size = bfd_get_section_size (sectp);
+      dwp_file->sections.loc.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->macinfo_dwo))
     {
       dwp_file->sections.macinfo.s.section = sectp;
-      dwp_file->sections.macinfo.size = bfd_get_section_size (sectp);
+      dwp_file->sections.macinfo.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->macro_dwo))
     {
       dwp_file->sections.macro.s.section = sectp;
-      dwp_file->sections.macro.size = bfd_get_section_size (sectp);
+      dwp_file->sections.macro.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->str_offsets_dwo))
     {
       dwp_file->sections.str_offsets.s.section = sectp;
-      dwp_file->sections.str_offsets.size = bfd_get_section_size (sectp);
+      dwp_file->sections.str_offsets.size = bfd_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->types_dwo))
     {
       dwp_file->sections.types.s.section = sectp;
-      dwp_file->sections.types.size = bfd_get_section_size (sectp);
+      dwp_file->sections.types.size = bfd_section_size (sectp);
     }
 }
 
index 630550b80dc326416a07aa2febaccfd17b71c5d0..901710f2833e0b811af983d2a6f85d6570c2f881 100644 (file)
@@ -125,7 +125,7 @@ elf_symfile_segments (bfd *abfd)
     {
       int j;
 
-      if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+      if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
        continue;
 
       Elf_Internal_Shdr *this_hdr = &elf_section_data (sect)->this_hdr;
@@ -146,10 +146,10 @@ elf_symfile_segments (bfd *abfd)
         RealView) use SHT_NOBITS for uninitialized data.  Since it is
         uninitialized, it doesn't need a program header.  Such
         binaries are not relocatable.  */
-      if (bfd_get_section_size (sect) > 0 && j == num_segments
-         && (bfd_get_section_flags (abfd, sect) & SEC_LOAD) != 0)
+      if (bfd_section_size (sect) > 0 && j == num_segments
+         && (bfd_section_flags (sect) & SEC_LOAD) != 0)
        warning (_("Loadable section \"%s\" outside of ELF segments"),
-                bfd_section_name (abfd, sect));
+                bfd_section_name (sect));
     }
 
   return data;
@@ -289,12 +289,12 @@ elf_symtab_read (minimal_symbol_reader &reader,
             covers the stub's address.  */
          for (sect = abfd->sections; sect != NULL; sect = sect->next)
            {
-             if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+             if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
                continue;
 
-             if (symaddr >= bfd_get_section_vma (abfd, sect)
-                 && symaddr < bfd_get_section_vma (abfd, sect)
-                              + bfd_get_section_size (sect))
+             if (symaddr >= bfd_section_vma (sect)
+                 && symaddr < bfd_section_vma (sect)
+                              + bfd_section_size (sect))
                break;
            }
          if (!sect)
@@ -591,9 +591,9 @@ elf_rel_plt_read (minimal_symbol_reader &reader,
       if (section == NULL)
        return false;
 
-      return (bfd_get_section_vma (obfd, section) <= address
-             && (address < bfd_get_section_vma (obfd, section)
-                 + bfd_get_section_size (section)));
+      return (bfd_section_vma (section) <= address
+             && (address < bfd_section_vma (section)
+                 + bfd_section_size (section)));
     };
 
   reloc_count = relplt->size / elf_section_data (relplt)->this_hdr.sh_entsize;
@@ -1236,7 +1236,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
        elfstab_build_psymtabs (objfile,
                                ei.stabsect,
                                str_sect->filepos,
-                               bfd_section_size (abfd, str_sect));
+                               bfd_section_size (str_sect));
     }
 
   if (dwarf2_has_info (objfile, NULL))
index 4e4cacffda07e97a3d17a14fddded7d700cb3d02..6bdf9abb3e42fc29837c7efadb5f07ad8913f5dc 100644 (file)
@@ -454,14 +454,14 @@ add_to_section_table (bfd *abfd, struct bfd_section *asect,
      encountered on sparc-solaris 2.10 a shared library with an empty .bss
      section to which a symbol named "_end" was attached.  The address
      of this symbol still needs to be relocated.  */
-  aflag = bfd_get_section_flags (abfd, asect);
+  aflag = bfd_section_flags (asect);
   if (!(aflag & SEC_ALLOC))
     return;
 
   (*table_pp)->owner = NULL;
   (*table_pp)->the_bfd_section = asect;
-  (*table_pp)->addr = bfd_section_vma (abfd, asect);
-  (*table_pp)->endaddr = (*table_pp)->addr + bfd_section_size (abfd, asect);
+  (*table_pp)->addr = bfd_section_vma (asect);
+  (*table_pp)->endaddr = (*table_pp)->addr + bfd_section_size (asect);
   (*table_pp)++;
 }
 
@@ -571,7 +571,7 @@ add_target_sections_of_objfile (struct objfile *objfile)
   /* Compute the number of sections to add.  */
   ALL_OBJFILE_OSECTIONS (objfile, osect)
     {
-      if (bfd_get_section_size (osect->the_bfd_section) == 0)
+      if (bfd_section_size (osect->the_bfd_section) == 0)
        continue;
       count++;
     }
@@ -585,7 +585,7 @@ add_target_sections_of_objfile (struct objfile *objfile)
 
   ALL_OBJFILE_OSECTIONS (objfile, osect)
     {
-      if (bfd_get_section_size (osect->the_bfd_section) == 0)
+      if (bfd_section_size (osect->the_bfd_section) == 0)
        continue;
 
       gdb_assert (ts < table->sections + space + count);
@@ -665,7 +665,7 @@ exec_read_partial_read_only (gdb_byte *readbuf, ULONGEST offset,
            continue;
 
          vma = s->vma;
-         size = bfd_get_section_size (s);
+         size = bfd_section_size (s);
          if (vma <= offset && offset < (vma + size))
            {
              ULONGEST amt;
@@ -705,9 +705,7 @@ section_table_available_memory (CORE_ADDR memaddr, ULONGEST len,
 
   for (target_section *p = sections; p < sections_end; p++)
     {
-      if ((bfd_get_section_flags (p->the_bfd_section->owner,
-                                 p->the_bfd_section)
-          & SEC_READONLY) == 0)
+      if ((bfd_section_flags (p->the_bfd_section) & SEC_READONLY) == 0)
        continue;
 
       /* Copy the meta-data, adjusted.  */
@@ -894,17 +892,16 @@ print_section_info (struct target_section_table *t, bfd *abfd)
       for (p = t->sections; p < t->sections_end; p++)
        {
          struct bfd_section *psect = p->the_bfd_section;
-         bfd *pbfd = psect->owner;
 
-         if ((bfd_get_section_flags (pbfd, psect) & (SEC_ALLOC | SEC_LOAD))
+         if ((bfd_section_flags (psect) & (SEC_ALLOC | SEC_LOAD))
              != (SEC_ALLOC | SEC_LOAD))
            continue;
 
-         if (bfd_get_section_vma (pbfd, psect) <= abfd->start_address
-             && abfd->start_address < (bfd_get_section_vma (pbfd, psect)
-                                       + bfd_get_section_size (psect)))
+         if (bfd_section_vma (psect) <= abfd->start_address
+             && abfd->start_address < (bfd_section_vma (psect)
+                                       + bfd_section_size (psect)))
            {
-             displacement = p->addr - bfd_get_section_vma (pbfd, psect);
+             displacement = p->addr - bfd_section_vma (psect);
              break;
            }
        }
@@ -935,7 +932,7 @@ print_section_info (struct target_section_table *t, bfd *abfd)
       if (info_verbose)
        printf_filtered (" @ %s",
                         hex_string_custom (psect->filepos, 8));
-      printf_filtered (" is %s", bfd_section_name (pbfd, psect));
+      printf_filtered (" is %s", bfd_section_name (psect));
       if (pbfd != abfd)
        printf_filtered (" in %s", bfd_get_filename (pbfd));
       printf_filtered ("\n");
@@ -975,9 +972,8 @@ set_section_command (const char *args, int from_tty)
   table = current_target_sections;
   for (p = table->sections; p < table->sections_end; p++)
     {
-      if (!strncmp (secname, bfd_section_name (p->bfd,
-                                              p->the_bfd_section), seclen)
-         && bfd_section_name (p->bfd, p->the_bfd_section)[seclen] == '\0')
+      if (!strncmp (secname, bfd_section_name (p->the_bfd_section), seclen)
+         && bfd_section_name (p->the_bfd_section)[seclen] == '\0')
        {
          offset = secaddr - p->addr;
          p->addr += offset;
index e81c6c99bff254bf63cb0f4e6ccba9dec3947f54..9422e3c1a7e1a65c76b088f42bb5986bd13a089f 100644 (file)
@@ -502,10 +502,10 @@ fbsd_core_thread_name (struct gdbarch *gdbarch, struct thread_info *thr)
       thread_section_name section_name (".thrmisc", thr->ptid);
 
       section = bfd_get_section_by_name (core_bfd, section_name.c_str ());
-      if (section != NULL && bfd_section_size (core_bfd, section) > 0)
+      if (section != NULL && bfd_section_size (section) > 0)
        {
          /* Truncate the name if it is longer than "buf".  */
-         size = bfd_section_size (core_bfd, section);
+         size = bfd_section_size (section);
          if (size > sizeof buf - 1)
            size = sizeof buf - 1;
          if (bfd_get_section_contents (core_bfd, section, buf, (file_ptr) 0,
@@ -1058,7 +1058,7 @@ fbsd_core_info_proc_files (struct gdbarch *gdbarch)
       return;
     }
 
-  size_t note_size = bfd_get_section_size (section);
+  size_t note_size = bfd_section_size (section);
   if (note_size < 4)
     error (_("malformed core note - too short for header"));
 
@@ -1191,7 +1191,7 @@ fbsd_core_info_proc_mappings (struct gdbarch *gdbarch)
       return;
     }
 
-  note_size = bfd_get_section_size (section);
+  note_size = bfd_section_size (section);
   if (note_size < 4)
     error (_("malformed core note - too short for header"));
 
@@ -1239,7 +1239,7 @@ fbsd_core_vnode_path (struct gdbarch *gdbarch, int fd)
   if (section == NULL)
     return nullptr;
 
-  note_size = bfd_get_section_size (section);
+  note_size = bfd_section_size (section);
   if (note_size < 4)
     error (_("malformed core note - too short for header"));
 
@@ -1344,7 +1344,7 @@ fbsd_core_info_proc_status (struct gdbarch *gdbarch)
    * structure size, then it must be long enough to access the last
    * field used (ki_rusage_ch.ru_majflt) which is the size of a long.
    */
-  note_size = bfd_get_section_size (section);
+  note_size = bfd_section_size (section);
   if (note_size < (4 + kp->ki_rusage_ch + kp->ru_majflt
                   + long_bit / TARGET_CHAR_BIT))
     error (_("malformed core note - too short"));
index eb108feb790c3c7d61c6c74fcfacdb2f20935f23..f283ed4580d9f2266dafeafcd09b88eca8a311fd 100644 (file)
@@ -95,9 +95,9 @@ write_gcore_file_1 (bfd *obfd)
     error (_("Failed to create 'note' section for corefile: %s"),
           bfd_errmsg (bfd_get_error ()));
 
-  bfd_set_section_vma (obfd, note_sec, 0);
-  bfd_set_section_alignment (obfd, note_sec, 0);
-  bfd_set_section_size (obfd, note_sec, note_size);
+  bfd_set_section_vma (note_sec, 0);
+  bfd_set_section_alignment (note_sec, 0);
+  bfd_set_section_size (note_sec, note_size);
 
   /* Now create the memory/load sections.  */
   if (gcore_memory_sections (obfd) == 0)
@@ -332,11 +332,11 @@ derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
 
   for (sec = abfd->sections; sec; sec = sec->next)
     {
-      if (bfd_get_section_flags (abfd, sec) & SEC_DATA
-         || strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
+      if (bfd_section_flags (sec) & SEC_DATA
+         || strcmp (".bss", bfd_section_name (sec)) == 0)
        {
-         sec_vaddr = bfd_get_section_vma (abfd, sec);
-         sec_size = bfd_get_section_size (sec);
+         sec_vaddr = bfd_section_vma (sec);
+         sec_size = bfd_section_size (sec);
          if (sec_vaddr + sec_size > top_of_data_memory)
            top_of_data_memory = sec_vaddr + sec_size;
        }
@@ -365,17 +365,17 @@ make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
   int p_type = 0;
 
   /* FIXME: these constants may only be applicable for ELF.  */
-  if (startswith (bfd_section_name (obfd, osec), "load"))
+  if (startswith (bfd_section_name (osec), "load"))
     p_type = PT_LOAD;
-  else if (startswith (bfd_section_name (obfd, osec), "note"))
+  else if (startswith (bfd_section_name (osec), "note"))
     p_type = PT_NOTE;
   else
     p_type = PT_NULL;
 
   p_flags |= PF_R;     /* Segment is readable.  */
-  if (!(bfd_get_section_flags (obfd, osec) & SEC_READONLY))
+  if (!(bfd_section_flags (osec) & SEC_READONLY))
     p_flags |= PF_W;   /* Segment is writable.  */
-  if (bfd_get_section_flags (obfd, osec) & SEC_CODE)
+  if (bfd_section_flags (osec) & SEC_CODE)
     p_flags |= PF_X;   /* Segment is executable.  */
 
   bfd_record_phdr (obfd, p_type, 1, p_flags, 0, 0, 0, 0, 1, &osec);
@@ -417,8 +417,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
          {
            bfd *abfd = objfile->obfd;
            asection *asec = objsec->the_bfd_section;
-           bfd_vma align = (bfd_vma) 1 << bfd_get_section_alignment (abfd,
-                                                                     asec);
+           bfd_vma align = (bfd_vma) 1 << bfd_section_alignment (asec);
            bfd_vma start = obj_section_addr (objsec) & -align;
            bfd_vma end = (obj_section_endaddr (objsec) + align - 1) & -align;
 
@@ -464,9 +463,9 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
                        plongest (size), paddress (target_gdbarch (), vaddr));
     }
 
-  bfd_set_section_size (obfd, osec, size);
-  bfd_set_section_vma (obfd, osec, vaddr);
-  bfd_section_lma (obfd, osec) = 0; /* ??? bfd_set_section_lma?  */
+  bfd_set_section_size (osec, size);
+  bfd_set_section_vma (osec, vaddr);
+  bfd_set_section_lma (osec, 0);
   return 0;
 }
 
@@ -482,9 +481,8 @@ objfile_find_memory_regions (struct target_ops *self,
   for (objfile *objfile : current_program_space->objfiles ())
     ALL_OBJFILE_OSECTIONS (objfile, objsec)
       {
-       bfd *ibfd = objfile->obfd;
        asection *isec = objsec->the_bfd_section;
-       flagword flags = bfd_get_section_flags (ibfd, isec);
+       flagword flags = bfd_section_flags (isec);
 
        /* Separate debug info files are irrelevant for gcore.  */
        if (objfile->separate_debug_objfile_backlink != NULL)
@@ -492,7 +490,7 @@ objfile_find_memory_regions (struct target_ops *self,
 
        if ((flags & SEC_ALLOC) || (flags & SEC_LOAD))
          {
-           int size = bfd_section_size (ibfd, isec);
+           int size = bfd_section_size (isec);
            int ret;
 
            ret = (*func) (obj_section_addr (objsec), size, 
@@ -530,15 +528,15 @@ objfile_find_memory_regions (struct target_ops *self,
 static void
 gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
 {
-  bfd_size_type size, total_size = bfd_section_size (obfd, osec);
+  bfd_size_type size, total_size = bfd_section_size (osec);
   file_ptr offset = 0;
 
   /* Read-only sections are marked; we don't have to copy their contents.  */
-  if ((bfd_get_section_flags (obfd, osec) & SEC_LOAD) == 0)
+  if ((bfd_section_flags (osec) & SEC_LOAD) == 0)
     return;
 
   /* Only interested in "load" sections.  */
-  if (!startswith (bfd_section_name (obfd, osec), "load"))
+  if (!startswith (bfd_section_name (osec), "load"))
     return;
 
   size = std::min (total_size, (bfd_size_type) MAX_COPY_BYTES);
@@ -549,13 +547,13 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
       if (size > total_size)
        size = total_size;
 
-      if (target_read_memory (bfd_section_vma (obfd, osec) + offset,
+      if (target_read_memory (bfd_section_vma (osec) + offset,
                              memhunk.data (), size) != 0)
        {
          warning (_("Memory read failed for corefile "
                     "section, %s bytes at %s."),
                   plongest (size),
-                  paddress (target_gdbarch (), bfd_section_vma (obfd, osec)));
+                  paddress (target_gdbarch (), bfd_section_vma (osec)));
          break;
        }
       if (!bfd_set_section_contents (obfd, osec, memhunk.data (),
index a17460a8a00d4e665a9a4b5bc11d4f18642a953a..8a67d5e97d72fe846e6d158cb0891685883d55ab 100644 (file)
@@ -480,7 +480,7 @@ static void
 free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
 {
   struct gdb_bfd_section_data *sect
-    = (struct gdb_bfd_section_data *) bfd_get_section_userdata (abfd, sectp);
+    = (struct gdb_bfd_section_data *) bfd_section_userdata (sectp);
 
   if (sect != NULL && sect->data != NULL)
     {
@@ -626,14 +626,13 @@ get_section_descriptor (asection *section)
 {
   struct gdb_bfd_section_data *result;
 
-  result = ((struct gdb_bfd_section_data *)
-           bfd_get_section_userdata (section->owner, section));
+  result = (struct gdb_bfd_section_data *) bfd_section_userdata (section);
 
   if (result == NULL)
     {
       result = ((struct gdb_bfd_section_data *)
                bfd_zalloc (section->owner, sizeof (*result)));
-      bfd_set_section_userdata (section->owner, section, result);
+      bfd_set_section_userdata (section, result);
     }
 
   return result;
@@ -671,9 +670,9 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
       /* Only try to mmap sections which are large enough: we don't want
         to waste space due to fragmentation.  */
 
-      if (bfd_get_section_size (sectp) > 4 * pagesize)
+      if (bfd_section_size (sectp) > 4 * pagesize)
        {
-         descriptor->size = bfd_get_section_size (sectp);
+         descriptor->size = bfd_section_size (sectp);
          descriptor->data = bfd_mmap (abfd, 0, descriptor->size, PROT_READ,
                                       MAP_PRIVATE, sectp->filepos,
                                       &descriptor->map_addr,
@@ -697,14 +696,14 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
   /* Handle compressed sections, or ordinary uncompressed sections in
      the no-mmap case.  */
 
-  descriptor->size = bfd_get_section_size (sectp);
+  descriptor->size = bfd_section_size (sectp);
   descriptor->data = NULL;
 
   data = NULL;
   if (!bfd_get_full_section_contents (abfd, sectp, &data))
     {
       warning (_("Can't read data for section '%s' in file '%s'"),
-              bfd_get_section_name (abfd, sectp),
+              bfd_section_name (sectp),
               bfd_get_filename (abfd));
       /* Set size to 0 to prevent further attempts to read the invalid
         section.  */
index aa67fc0a1403ec88d3972d712c2af6099680c3b9..674880d07fff9e52e1cd873a25536e4df94b0bba 100644 (file)
@@ -106,7 +106,7 @@ void gdb_bfd_record_inclusion (bfd *includer, bfd *includee);
 
 /* Try to read or map the contents of the section SECT.  If successful, the
    section data is returned and *SIZE is set to the size of the section data;
-   this may not be the same as the size according to bfd_get_section_size if the
+   this may not be the same as the size according to bfd_section_size if the
    section was compressed.  The returned section data is associated with the BFD
    and will be destroyed when the BFD is destroyed.  There is no other way to
    free it; for temporary uses of section data, see bfd_malloc_and_get_section.
index b1f71883ec38d68d3c4d986f5be1cac4356a6870..249d5c91bd176ac34a66a299a68cfab1942647ad 100644 (file)
@@ -380,7 +380,7 @@ read_unwind_info (struct objfile *objfile)
       if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
          || strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
        {
-         unwind_size = bfd_section_size (objfile->obfd, unwind_sec);
+         unwind_size = bfd_section_size (unwind_sec);
          unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
 
          total_entries += unwind_entries;
@@ -393,7 +393,7 @@ read_unwind_info (struct objfile *objfile)
 
   if (stub_unwind_sec)
     {
-      stub_unwind_size = bfd_section_size (objfile->obfd, stub_unwind_sec);
+      stub_unwind_size = bfd_section_size (stub_unwind_sec);
       stub_entries = stub_unwind_size / STUB_UNWIND_ENTRY_SIZE;
     }
   else
@@ -421,7 +421,7 @@ read_unwind_info (struct objfile *objfile)
       if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
          || strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
        {
-         unwind_size = bfd_section_size (objfile->obfd, unwind_sec);
+         unwind_size = bfd_section_size (unwind_sec);
          unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
 
          internalize_unwinds (objfile, &ui->table[index], unwind_sec,
index 0e3ba82b76474f2479da16522fb483cb17467c87..25c3cfcbb9882ea37100eccb9e74ef96e91509e5 100644 (file)
@@ -110,14 +110,14 @@ core_process_module_section (bfd *abfd, asection *sect, void *obj)
   if (!startswith (sect->name, ".module"))
     return;
 
-  buf = (gdb_byte *) xmalloc (bfd_get_section_size (sect) + 1);
+  buf = (gdb_byte *) xmalloc (bfd_section_size (sect) + 1);
   if (!buf)
     {
       printf_unfiltered ("memory allocation failed for %s\n", sect->name);
       goto out;
     }
   if (!bfd_get_section_contents (abfd, sect,
-                                buf, 0, bfd_get_section_size (sect)))
+                                buf, 0, bfd_section_size (sect)))
     goto out;
 
 
@@ -130,7 +130,7 @@ core_process_module_section (bfd *abfd, asection *sect, void *obj)
   module_name_size =
     extract_unsigned_integer (buf + 8, 4, byte_order);
 
-  if (12 + module_name_size > bfd_get_section_size (sect))
+  if (12 + module_name_size > bfd_section_size (sect))
     goto out;
   module_name = (char *) buf + 12;
 
@@ -240,7 +240,7 @@ i386_cygwin_osabi_sniffer (bfd *abfd)
     {
       asection *section = bfd_get_section_by_name (abfd, ".reg");
       if (section
-         && bfd_section_size (abfd, section) == I386_WINDOWS_SIZEOF_GREGSET)
+         && bfd_section_size (section) == I386_WINDOWS_SIZEOF_GREGSET)
        return GDB_OSABI_CYGWIN;
     }
 
index 3848bf890d48f1792f54525917d6c83b2ccd625a..04d0a641b72cbbc5fac9e3eec10ae6841639bc3a 100644 (file)
@@ -233,7 +233,7 @@ i386fbsd_core_read_xcr0 (bfd *abfd)
 
   if (xstate)
     {
-      size_t size = bfd_section_size (abfd, xstate);
+      size_t size = bfd_section_size (xstate);
 
       /* Check extended state size.  */
       if (size < X86_XSTATE_AVX_SIZE)
index 760d00008f432c53c389547266c8525d531cdb20..c41013984ee0c6f9d70afebf8d1da7ecb7c574fe 100644 (file)
@@ -646,7 +646,7 @@ i386_linux_core_read_xcr0 (bfd *abfd)
 
   if (xstate)
     {
-      size_t size = bfd_section_size (abfd, xstate);
+      size_t size = bfd_section_size (xstate);
 
       /* Check extended state size.  */
       if (size < X86_XSTATE_AVX_SIZE)
index 4722d6c6ce4a9903061be07191064ed3ea96657d..af01b4d6c4fe3f1d997b6ab2867fed93e1c0b84c 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -910,12 +910,12 @@ JITed symbol file is not an object file, ignoring it.\n"));
      addresses that we care about.  */
   section_addr_info sai;
   for (sec = nbfd->sections; sec != NULL; sec = sec->next)
-    if ((bfd_get_section_flags (nbfd.get (), sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
+    if ((bfd_section_flags (sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
       {
         /* We assume that these virtual addresses are absolute, and do not
            treat them as offsets.  */
-       sai.emplace_back (bfd_get_section_vma (nbfd.get (), sec),
-                         bfd_get_section_name (nbfd.get (), sec),
+       sai.emplace_back (bfd_section_vma (sec),
+                         bfd_section_name (sec),
                          sec->index);
       }
 
index ff888a90678b0cbb3932a609cd347eeb9c3367ce..63a9bd32dfd3f066640d947e1fb57e30e4fd07c9 100644 (file)
@@ -1046,7 +1046,7 @@ linux_core_info_proc_mappings (struct gdbarch *gdbarch, const char *args)
 
   addr_size_bits = gdbarch_addr_bit (core_gdbarch);
   addr_size = addr_size_bits / 8;
-  note_size = bfd_get_section_size (section);
+  note_size = bfd_section_size (section);
 
   if (note_size < 2 * addr_size)
     error (_("malformed core note - too short for header"));
index d7471e9572c1283d5efe1a25be0fef53efe6623a..1795982a3e8200659f676e2cfac1d2c063c97e89 100644 (file)
@@ -575,7 +575,7 @@ macho_add_oso_symfile (oso_el *oso, const gdb_bfd_ref_ptr &abfd,
                          sec->name, sym->name,
                          paddress (arch, res));
                     }
-                  bfd_set_section_vma (abfd.get (), sec, res);
+                  bfd_set_section_vma (sec, res);
                   sections_rebased[sec->index] = 1;
                 }
             }
@@ -854,8 +854,7 @@ macho_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
             {
               if (strcmp (asect->name, dsect->name) != 0)
                 break;
-              bfd_set_section_size (dsym_bfd.get (), dsect,
-                                    bfd_get_section_size (asect));
+              bfd_set_section_size (dsect, bfd_section_size (asect));
             }
 
          /* Add the dsym file as a separate file.  */
index b8eb93827c8f7494815a41721487f298589ab1b5..ec9f4abb26466936c76fc9bc0cef8a1091e616c9 100644 (file)
@@ -335,8 +335,8 @@ print_bfd_section_info (bfd *abfd,
                        asection *asect,
                        void *datum)
 {
-  flagword flags = bfd_get_section_flags (abfd, asect);
-  const char *name = bfd_section_name (abfd, asect);
+  flagword flags = bfd_section_flags (asect);
+  const char *name = bfd_section_name (asect);
   maint_print_section_data *print_data = (maint_print_section_data *) datum;
   const char *arg = print_data->arg;
 
@@ -348,8 +348,8 @@ print_bfd_section_info (bfd *abfd,
       int addr_size = gdbarch_addr_bit (gdbarch) / 8;
       CORE_ADDR addr, endaddr;
 
-      addr = bfd_section_vma (abfd, asect);
-      endaddr = addr + bfd_section_size (abfd, asect);
+      addr = bfd_section_vma (asect);
+      endaddr = addr + bfd_section_size (asect);
       print_section_index (abfd, asect, print_data->index_digits);
       maint_print_section_info (name, flags, addr, endaddr,
                                asect->filepos, addr_size);
@@ -366,8 +366,8 @@ print_objfile_section_info (bfd *abfd,
                            struct obj_section *asect,
                            maint_print_section_data *print_data)
 {
-  flagword flags = bfd_get_section_flags (abfd, asect->the_bfd_section);
-  const char *name = bfd_section_name (abfd, asect->the_bfd_section);
+  flagword flags = bfd_section_flags (asect->the_bfd_section);
+  const char *name = bfd_section_name (asect->the_bfd_section);
   const char *string = print_data->arg;
 
   if (string == NULL || *string == '\0'
index dffef8fd1a4cac5c4b6f22eb4a2459c080b3bc8a..0956fbdb6755467e187eac38799e21edbb7df6a0 100644 (file)
@@ -2338,7 +2338,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
      the text section (and fh->adr) really starts at zero.  */
   text_sect = bfd_get_section_by_name (cur_bfd, ".text");
   if (text_sect != NULL
-      && (bfd_get_section_flags (cur_bfd, text_sect) & SEC_RELOC))
+      && (bfd_section_flags (text_sect) & SEC_RELOC))
     relocatable = 1;
 
   extern_tab = XOBNEWVEC (&objfile->objfile_obstack, EXTR, hdr->iextMax);
index 9033a61950d5fd4792dca42e3e01c57326aed1d2..7659e2803823b927a2928d69c660b9e6ada59708 100644 (file)
@@ -1179,8 +1179,7 @@ mi_memory_changed (struct inferior *inferior, CORE_ADDR memaddr,
       sec = find_pc_section (memaddr);
       if (sec != NULL && sec->objfile != NULL)
        {
-         flagword flags = bfd_get_section_flags (sec->objfile->obfd,
-                                                 sec->the_bfd_section);
+         flagword flags = bfd_section_flags (sec->the_bfd_section);
 
          if (flags & SEC_CODE)
            mi_uiout->field_string ("type", "code");
index 6c67b4e04b30c73c4989daa546d4d3c66c3deb98..2a60741dfaff687b37f07986a69ea48876cebd5e 100644 (file)
@@ -87,7 +87,7 @@ lzma_open (struct bfd *nbfd, void *open_closure)
   struct gdb_lzma_stream *lstream;
   size_t pos;
 
-  size = bfd_get_section_size (section);
+  size = bfd_section_size (section);
   offset = section->filepos + size - LZMA_STREAM_HEADER_SIZE;
   if (size < LZMA_STREAM_HEADER_SIZE
       || bfd_seek (section->owner, offset, SEEK_SET) != 0
index 08d027917d837f12463f9470559169dc5a76c159..eab284da1304b36c8c1903cfc9c120d71d416620 100644 (file)
@@ -562,7 +562,7 @@ mips_linux_core_read_description (struct gdbarch *gdbarch,
   if (! section)
     return NULL;
 
-  switch (bfd_section_size (abfd, section))
+  switch (bfd_section_size (section))
     {
     case sizeof (mips_elf_gregset_t):
       return mips_tdesc_gp32;
index cf1ce3787372d2149b49b31450034fc392f934a0..791a5991ad54384c21d7d8220feb18b2896b8d80 100644 (file)
@@ -208,7 +208,7 @@ mips_sde_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect,
   enum gdb_osabi *os_ident_ptr = (enum gdb_osabi *) obj;
   const char *name;
 
-  name = bfd_get_section_name (abfd, sect);
+  name = bfd_section_name (sect);
 
   /* The presence of a section with a ".sde" prefix is indicative
      of an SDE binary.  */
index 37a1b2a0b8f372554babca69889da144f416aa76..6870db82024a4b3f9344bb2f7bbe0f530bfb1810 100644 (file)
@@ -7975,7 +7975,7 @@ static void
 mips_find_abi_section (bfd *abfd, asection *sect, void *obj)
 {
   enum mips_abi *abip = (enum mips_abi *) obj;
-  const char *name = bfd_get_section_name (abfd, sect);
+  const char *name = bfd_section_name (sect);
 
   if (*abip != MIPS_ABI_UNKNOWN)
     return;
@@ -8003,7 +8003,7 @@ static void
 mips_find_long_section (bfd *abfd, asection *sect, void *obj)
 {
   int *lbp = (int *) obj;
-  const char *name = bfd_get_section_name (abfd, sect);
+  const char *name = bfd_section_name (sect);
 
   if (startswith (name, ".gcc_compiled_long32"))
     *lbp = 32;
index b25abe5a481305b43076a6e16cf7c95289f3952b..b5f7f6cde4b92e79387aa67767443e005539c031 100644 (file)
@@ -200,10 +200,10 @@ read_alphacoff_dynamic_symtab (minimal_symbol_reader &reader,
       || si.dyninfo_sect == NULL || si.got_sect == NULL)
     return;
 
-  gdb::byte_vector sym_sec (bfd_get_section_size (si.sym_sect));
-  gdb::byte_vector str_sec (bfd_get_section_size (si.str_sect));
-  gdb::byte_vector dyninfo_sec (bfd_get_section_size (si.dyninfo_sect));
-  gdb::byte_vector got_sec (bfd_get_section_size (si.got_sect));
+  gdb::byte_vector sym_sec (bfd_section_size (si.sym_sect));
+  gdb::byte_vector str_sec (bfd_section_size (si.str_sect));
+  gdb::byte_vector dyninfo_sec (bfd_section_size (si.dyninfo_sect));
+  gdb::byte_vector got_sec (bfd_section_size (si.got_sect));
 
   if (!bfd_get_section_contents (abfd, si.sym_sect, sym_sec.data (),
                                 (file_ptr) 0, sym_sec.size ()))
index 0c610d28419403393eec0ff05906ae9259d8711f..41b4e257373ddbd0cee8c752ced6ffbbfb752986 100644 (file)
@@ -319,8 +319,8 @@ nto_sniff_abi_note_section (bfd *abfd, asection *sect, void *obj)
   const char *name;
   const unsigned sizeof_Elf_Nhdr = 12;
 
-  sectname = bfd_get_section_name (abfd, sect);
-  sectsize = bfd_section_size (abfd, sect);
+  sectname = bfd_section_name (sect);
+  sectsize = bfd_section_size (sect);
 
   if (sectsize > 128)
     sectsize = 128;
index 7cbcbbd01b0e9b776afac6180b3f2d733d156520..90c4650bd47bec55dfdebab523dbc41f07e16869 100644 (file)
@@ -271,7 +271,7 @@ add_to_objfile_sections_full (struct bfd *abfd, struct bfd_section *asect,
     {
       flagword aflag;
 
-      aflag = bfd_get_section_flags (abfd, asect);
+      aflag = bfd_section_flags (asect);
       if (!(aflag & SEC_ALLOC))
        return;
     }
@@ -1119,15 +1119,15 @@ static int
 insert_section_p (const struct bfd *abfd,
                  const struct bfd_section *section)
 {
-  const bfd_vma lma = bfd_section_lma (abfd, section);
+  const bfd_vma lma = bfd_section_lma (section);
 
-  if (overlay_debugging && lma != 0 && lma != bfd_section_vma (abfd, section)
+  if (overlay_debugging && lma != 0 && lma != bfd_section_vma (section)
       && (bfd_get_file_flags (abfd) & BFD_IN_MEMORY) == 0)
     /* This is an overlay section.  IN_MEMORY check is needed to avoid
        discarding sections from the "system supplied DSO" (aka vdso)
        on some Linux systems (e.g. Fedora 11).  */
     return 0;
-  if ((bfd_get_section_flags (abfd, section) & SEC_THREAD_LOCAL) != 0)
+  if ((bfd_section_flags (section) & SEC_THREAD_LOCAL) != 0)
     /* This is a TLS section.  */
     return 0;
 
@@ -1220,10 +1220,10 @@ filter_overlapping_sections (struct obj_section **map, int map_size)
                           " (A) section `%s' from `%s' [%s, %s)\n"
                           " (B) section `%s' from `%s' [%s, %s).\n"
                           "Will ignore section B"),
-                        bfd_section_name (abfd1, bfds1), objfile_name (objf1),
+                        bfd_section_name (bfds1), objfile_name (objf1),
                         paddress (gdbarch, sect1_addr),
                         paddress (gdbarch, sect1_endaddr),
-                        bfd_section_name (abfd2, bfds2), objfile_name (objf2),
+                        bfd_section_name (bfds2), objfile_name (objf2),
                         paddress (gdbarch, sect2_addr),
                         paddress (gdbarch, sect2_endaddr));
            }
index 239aba2c2a1fb6cdd3735e024305e8c16199e992..68d36d408e1f605692c234ec8d13ff0d738ee67a 100644 (file)
@@ -143,14 +143,14 @@ struct obj_section
 
 /* The memory address of section S (vma + offset).  */
 #define obj_section_addr(s)                                            \
-  (bfd_get_section_vma ((s)->objfile->obfd, s->the_bfd_section)                \
+  (bfd_section_vma (s->the_bfd_section)                                        \
    + obj_section_offset (s))
 
 /* The one-passed-the-end memory address of section S
    (vma + size + offset).  */
 #define obj_section_endaddr(s)                                         \
-  (bfd_get_section_vma ((s)->objfile->obfd, s->the_bfd_section)                \
-   + bfd_get_section_size ((s)->the_bfd_section)                       \
+  (bfd_section_vma (s->the_bfd_section)                                        \
+   + bfd_section_size ((s)->the_bfd_section)                           \
    + obj_section_offset (s))
 
 /* The "objstats" structure provides a place for gdb to record some
index 5d4bbcdff84e8150a2319d7bbf1603ce4d0fc13c..cdf72a7664f82fe8140ffd8b5900848355b1081b 100644 (file)
@@ -416,7 +416,7 @@ check_note (bfd *abfd, asection *sect, char *note, unsigned int *sectsize,
   gdb_assert (notesz <= MAX_NOTESZ);
 
   /* Check whether SECT is big enough to comtain the complete note.  */
-  if (notesz > bfd_section_size (abfd, sect))
+  if (notesz > bfd_section_size (sect))
     return 0;
 
   /* Check the note name.  */
@@ -445,8 +445,8 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
   unsigned int sectsize;
   char *note;
 
-  name = bfd_get_section_name (abfd, sect);
-  sectsize = bfd_section_size (abfd, sect);
+  name = bfd_section_name (sect);
+  sectsize = bfd_section_size (sect);
 
   /* Limit the amount of data to read.  */
   if (sectsize > MAX_NOTESZ)
index 82277a03f896f243c605e2ebbec8d6206182267c..c6181c9dd489164dfb2a8ea9c5f85e595c4d498a 100644 (file)
@@ -1558,7 +1558,7 @@ ppc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
 static int
 ppc_linux_spu_section (bfd *abfd, asection *asect, void *user_data)
 {
-  return startswith (bfd_section_name (abfd, asect), "SPU/");
+  return startswith (bfd_section_name (asect), "SPU/");
 }
 
 static const struct target_desc *
@@ -1580,7 +1580,7 @@ ppc_linux_core_read_description (struct gdbarch *gdbarch,
   if (! section)
     return NULL;
 
-  switch (bfd_section_size (abfd, section))
+  switch (bfd_section_size (section))
     {
     case 48 * 4:
       features.wordsize = 4;
index b29d04c13542a850e1b7c5f13eeddc286de6e664..6a7aabf877a4ebdbd30fac2e71f7312320542abf 100644 (file)
@@ -593,8 +593,8 @@ ppc64_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
                                      s->the_bfd_section,
                                      &buf, addr - s->addr, 8);
       if (res != 0)
-       return extract_unsigned_integer (buf, 8, byte_order)
-               - bfd_section_vma (s->bfd, s->the_bfd_section) + s->addr;
+       return (extract_unsigned_integer (buf, 8, byte_order)
+               - bfd_section_vma (s->the_bfd_section) + s->addr);
    }
 
   return addr;
index d402d8733dd3889b8dccae8375e20d412b91393b..b55459e4ad1a9198f710f979e3fdc8b35bd7a938 100644 (file)
@@ -1435,8 +1435,7 @@ record_btrace_target::xfer_partial (enum target_object object,
            if (section != NULL)
              {
                /* Check if the section we found is readonly.  */
-               if ((bfd_get_section_flags (section->the_bfd_section->owner,
-                                           section->the_bfd_section)
+               if ((bfd_section_flags (section->the_bfd_section)
                     & SEC_READONLY) != 0)
                  {
                    /* Truncate the request to fit into this section.  */
index c1d124f51926bfd8f2491f81f293f3097bcf1fef..0c6cb621630c27be28d153b5c98fa9217913e86c 100644 (file)
@@ -2350,9 +2350,9 @@ record_full_restore (void)
                        osec ? "succeeded" : "failed");
   if (osec == NULL)
     return;
-  osec_size = bfd_section_size (core_bfd, osec);
+  osec_size = bfd_section_size (osec);
   if (record_debug)
-    fprintf_unfiltered (gdb_stdlog, "%s", bfd_section_name (core_bfd, osec));
+    fprintf_unfiltered (gdb_stdlog, "%s", bfd_section_name (osec));
 
   /* Check the magic code.  */
   bfdcore_read (core_bfd, osec, &magic, sizeof (magic), &bfd_offset);
@@ -2599,10 +2599,9 @@ record_full_base_target::save_record (const char *recfilename)
     error (_("Failed to create 'precord' section for corefile %s: %s"),
           recfilename,
            bfd_errmsg (bfd_get_error ()));
-  bfd_set_section_size (obfd.get (), osec, save_size);
-  bfd_set_section_vma (obfd.get (), osec, 0);
-  bfd_set_section_alignment (obfd.get (), osec, 0);
-  bfd_section_lma (obfd.get (), osec) = 0;
+  bfd_set_section_size (osec, save_size);
+  bfd_set_section_vma (osec, 0);
+  bfd_set_section_alignment (osec, 0);
 
   /* Save corefile state.  */
   write_gcore_file (obfd.get ());
index e39366d8b209ac15d155ccae6bc2c3a1f47a18d8..980864e0707351f26d99f1d007ecda141782d238 100644 (file)
@@ -8749,9 +8749,7 @@ remote_target::remote_xfer_live_readonly_partial (gdb_byte *readbuf,
 
   secp = target_section_by_addr (this, memaddr);
   if (secp != NULL
-      && (bfd_get_section_flags (secp->the_bfd_section->owner,
-                                secp->the_bfd_section)
-         & SEC_READONLY))
+      && (bfd_section_flags (secp->the_bfd_section) & SEC_READONLY))
     {
       struct target_section *p;
       ULONGEST memend = memaddr + len;
@@ -10656,11 +10654,11 @@ compare_sections_command (const char *args, int from_tty)
       if (read_only && (s->flags & SEC_READONLY) == 0)
        continue;               /* Skip writeable sections */
 
-      size = bfd_get_section_size (s);
+      size = bfd_section_size (s);
       if (size == 0)
        continue;               /* Skip zero-length section.  */
 
-      sectname = bfd_get_section_name (exec_bfd, s);
+      sectname = bfd_section_name (s);
       if (args && strcmp (args, sectname) != 0)
        continue;               /* Not the section selected by user.  */
 
@@ -13059,7 +13057,6 @@ void
 remote_target::trace_set_readonly_regions ()
 {
   asection *s;
-  bfd *abfd = NULL;
   bfd_size_type size;
   bfd_vma vma;
   int anysecs = 0;
@@ -13083,8 +13080,8 @@ remote_target::trace_set_readonly_regions ()
        continue;
 
       anysecs = 1;
-      vma = bfd_get_section_vma (abfd, s);
-      size = bfd_get_section_size (s);
+      vma = bfd_section_vma (s);
+      size = bfd_section_size (s);
       sprintf_vma (tmp1, vma);
       sprintf_vma (tmp2, vma + size);
       sec_length = 1 + strlen (tmp1) + 1 + strlen (tmp2);
index 4964f591a5a916790900f83787449ce47f38ef1c..f2ff2557368f10c45d401abccf102d15f24e2af6 100644 (file)
@@ -1110,7 +1110,7 @@ rs6000_aix_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch,
   if (ldinfo_sec == NULL)
     error (_("cannot find .ldinfo section from core file: %s"),
           bfd_errmsg (bfd_get_error ()));
-  ldinfo_size = bfd_get_section_size (ldinfo_sec);
+  ldinfo_size = bfd_section_size (ldinfo_sec);
 
   gdb::byte_vector ldinfo_buf (ldinfo_size);
 
index 328b41cc595c2257e708ef2ebcf8764f1ffec5d0..47a232f6c6ad8e81655f222bb8aabe284cd87a9a 100644 (file)
@@ -3866,7 +3866,7 @@ bfd_uses_spe_extensions (bfd *abfd)
   if (!sect)
     return 0;
 
-  size = bfd_get_section_size (sect);
+  size = bfd_section_size (sect);
   contents = (gdb_byte *) xmalloc (size);
   if (!bfd_get_section_contents (abfd, sect, contents, 0, size))
     {
index 02ae28b4ea7675b23b3c4cd24d3caf7b99bcf8a9..ab3889ba45a725ad7b70ad6c0a7be61888bda102 100644 (file)
@@ -346,7 +346,7 @@ s390_core_read_description (struct gdbarch *gdbarch,
   te = (hwcap & HWCAP_S390_TE);
   gs = (hwcap & HWCAP_S390_GS);
 
-  switch (bfd_section_size (abfd, section))
+  switch (bfd_section_size (section))
     {
     case s390_sizeof_gregset:
       if (high_gprs)
index 871efc59bca0720d77ea9cf620eb5c8b3d4f9773..463c0a0bd73ff28654facf9c3849f9e034db2fd0 100644 (file)
@@ -697,9 +697,7 @@ s390_load (struct s390_prologue_data *data,
       struct target_section *secp;
       secp = target_section_by_addr (current_top_target (), addr.k);
       if (secp != NULL
-         && (bfd_get_section_flags (secp->the_bfd_section->owner,
-                                    secp->the_bfd_section)
-             & SEC_READONLY))
+         && (bfd_section_flags (secp->the_bfd_section) & SEC_READONLY))
        return pv_constant (read_memory_integer (addr.k, size,
                                                 data->byte_order));
     }
index 1a25a0d4a93117c81f8927da812796076c4bbcb9..8308190d90cd0f8933ef4b899e72dd13ce629ee1 100644 (file)
@@ -303,15 +303,13 @@ solib_aix_bss_data_overlap (bfd *abfd)
      section after the .data section (the problem has only been
      observed when using the GNU linker, and the default linker
      script always places the .data and .bss sections in that order).  */
-  if (bfd_section_vma (abfd, bss_sect)
-      < bfd_section_vma (abfd, data_sect))
+  if (bfd_section_vma (bss_sect) < bfd_section_vma (data_sect))
     return 0;
 
-  if (bfd_section_vma (abfd, bss_sect)
-      < bfd_section_vma (abfd, data_sect) + bfd_get_section_size (data_sect))
-    return ((bfd_section_vma (abfd, data_sect)
-            + bfd_get_section_size (data_sect))
-           - bfd_section_vma (abfd, bss_sect));
+  if (bfd_section_vma (bss_sect)
+      < bfd_section_vma (data_sect) + bfd_section_size (data_sect))
+    return (bfd_section_vma (data_sect) + bfd_section_size (data_sect)
+           - bfd_section_vma (bss_sect));
 
   return 0;
 }
@@ -324,7 +322,7 @@ solib_aix_relocate_section_addresses (struct so_list *so,
 {
   struct bfd_section *bfd_sect = sec->the_bfd_section;
   bfd *abfd = bfd_sect->owner;
-  const char *section_name = bfd_section_name (abfd, bfd_sect);
+  const char *section_name = bfd_section_name (bfd_sect);
   lm_info_aix *info = (lm_info_aix *) so->lm_info;
 
   if (strcmp (section_name, ".text") == 0)
@@ -355,17 +353,17 @@ solib_aix_relocate_section_addresses (struct so_list *so,
       CORE_ADDR data_offset = 0;
 
       if (data_sect != NULL)
-       data_offset = info->data_addr - bfd_section_vma (abfd, data_sect);
+       data_offset = info->data_addr - bfd_section_vma (data_sect);
 
-      sec->addr = bfd_section_vma (abfd, bfd_sect) + data_offset;
+      sec->addr = bfd_section_vma (bfd_sect) + data_offset;
       sec->addr += solib_aix_bss_data_overlap (abfd);
-      sec->endaddr = sec->addr + bfd_section_size (abfd, bfd_sect);
+      sec->endaddr = sec->addr + bfd_section_size (bfd_sect);
     }
   else
     {
       /* All other sections should not be relocated.  */
-      sec->addr = bfd_section_vma (abfd, bfd_sect);
-      sec->endaddr = sec->addr + bfd_section_size (abfd, bfd_sect);
+      sec->addr = bfd_section_vma (bfd_sect);
+      sec->endaddr = sec->addr + bfd_section_size (bfd_sect);
     }
 }
 
@@ -414,7 +412,7 @@ solib_aix_get_section_offsets (struct objfile *objfile,
        = objfile->sections[objfile->sect_index_text].the_bfd_section;
 
       offsets->offsets[objfile->sect_index_text]
-       = info->text_addr + sect->filepos - bfd_section_vma (abfd, sect);
+       = info->text_addr + sect->filepos - bfd_section_vma (sect);
     }
 
   /* .data */
@@ -425,7 +423,7 @@ solib_aix_get_section_offsets (struct objfile *objfile,
        = objfile->sections[objfile->sect_index_data].the_bfd_section;
 
       offsets->offsets[objfile->sect_index_data]
-       = info->data_addr - bfd_section_vma (abfd, sect);
+       = info->data_addr - bfd_section_vma (sect);
     }
 
   /* .bss
@@ -661,8 +659,7 @@ data_obj_section_from_objfile (struct objfile *objfile)
   struct obj_section *osect;
 
   ALL_OBJFILE_OSECTIONS (objfile, osect)
-    if (strcmp (bfd_section_name (objfile->obfd, osect->the_bfd_section),
-               ".data") == 0)
+    if (strcmp (bfd_section_name (osect->the_bfd_section), ".data") == 0)
       return osect;
 
   return NULL;
index 59b195f491eb06f9d514bd7b53f83ec2f36c9f1a..70d6f2e314b668c6c20c1e258cbfdaf04a28285b 100644 (file)
@@ -438,12 +438,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
         such fallback to the file VMA address without the possibility of
         having the section relocated to its actual in-memory address.  */
 
-      dyn_addr = bfd_section_vma (abfd, sect);
+      dyn_addr = bfd_section_vma (sect);
     }
 
   /* Read in .dynamic from the BFD.  We will get the actual value
      from memory later.  */
-  sect_size = bfd_section_size (abfd, sect);
+  sect_size = bfd_section_size (sect);
   buf = bufstart = (gdb_byte *) alloca (sect_size);
   if (!bfd_get_section_contents (abfd, sect,
                                 buf, 0, sect_size))
@@ -807,7 +807,7 @@ enable_break (void)
 
       /* Read the contents of the .interp section into a local buffer;
         the contents specify the dynamic linker this program uses.  */
-      interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
+      interp_sect_size = bfd_section_size (interp_sect);
       buf = (char *) alloca (interp_sect_size);
       bfd_get_section_contents (exec_bfd, interp_sect,
                                buf, 0, interp_sect_size);
@@ -839,24 +839,20 @@ enable_break (void)
       interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".text");
       if (interp_sect)
        {
-         info->interp_text_sect_low
-           = bfd_section_vma (tmp_bfd.get (), interp_sect);
+         info->interp_text_sect_low = bfd_section_vma (interp_sect);
          info->interp_text_sect_low
            += displacement_from_map (ldm, info->interp_text_sect_low);
          info->interp_text_sect_high
-           = info->interp_text_sect_low
-           + bfd_section_size (tmp_bfd.get (), interp_sect);
+           = info->interp_text_sect_low + bfd_section_size (interp_sect);
        }
       interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".plt");
       if (interp_sect)
        {
-         info->interp_plt_sect_low =
-           bfd_section_vma (tmp_bfd.get (), interp_sect);
+         info->interp_plt_sect_low = bfd_section_vma (interp_sect);
          info->interp_plt_sect_low
            += displacement_from_map (ldm, info->interp_plt_sect_low);
-         info->interp_plt_sect_high =
-           info->interp_plt_sect_low + bfd_section_size (tmp_bfd.get (),
-                                                         interp_sect);
+         info->interp_plt_sect_high
+           = info->interp_plt_sect_low + bfd_section_size (interp_sect);
        }
 
       addr = gdb_bfd_lookup_symbol (tmp_bfd.get (), cmp_name,
index fdd4b3453057023755d155f11fa8f084dc36bf93..08fa5768676bedabf9216ddc45194ab5ba952873 100644 (file)
@@ -546,7 +546,7 @@ enable_break2 (void)
 
       /* Read the contents of the .interp section into a local buffer;
          the contents specify the dynamic linker this program uses.  */
-      interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
+      interp_sect_size = bfd_section_size (interp_sect);
       buf = (char *) alloca (interp_sect_size);
       bfd_get_section_contents (exec_bfd, interp_sect,
                                buf, 0, interp_sect_size);
@@ -603,24 +603,20 @@ enable_break2 (void)
       interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".text");
       if (interp_sect)
        {
-         interp_text_sect_low
-           = bfd_section_vma (tmp_bfd.get (), interp_sect);
+         interp_text_sect_low = bfd_section_vma (interp_sect);
          interp_text_sect_low
            += displacement_from_map (ldm, interp_text_sect_low);
          interp_text_sect_high
-           = interp_text_sect_low + bfd_section_size (tmp_bfd.get (),
-                                                      interp_sect);
+           = interp_text_sect_low + bfd_section_size (interp_sect);
        }
       interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".plt");
       if (interp_sect)
        {
-         interp_plt_sect_low =
-           bfd_section_vma (tmp_bfd.get (), interp_sect);
+         interp_plt_sect_low = bfd_section_vma (interp_sect);
          interp_plt_sect_low
            += displacement_from_map (ldm, interp_plt_sect_low);
          interp_plt_sect_high =
-           interp_plt_sect_low + bfd_section_size (tmp_bfd.get (),
-                                                   interp_sect);
+           interp_plt_sect_low + bfd_section_size (interp_sect);
        }
 
       addr = gdb_bfd_lookup_symbol (tmp_bfd.get (), cmp_name, "_dl_debug_addr");
index c5e0acaf02ac23bb50d74ba6576ec3b6248b07b2..49e470adb62dadb4c4e3849899f8819cc78c885a 100644 (file)
@@ -364,7 +364,7 @@ spu_bfd_open (const char *pathname)
   spu_name = bfd_get_section_by_name (abfd.get (), ".note.spu_name");
   if (spu_name)
     {
-      int sect_size = bfd_section_size (abfd.get (), spu_name);
+      int sect_size = bfd_section_size (spu_name);
 
       if (sect_size > 20)
        {
index ffae26bfc5f08e503cb33b47d07ee39db56a51fe..e04fde942d15b8fb0d9827d77f1794b35a3c76d3 100644 (file)
@@ -234,7 +234,7 @@ lm_addr_check (const struct so_list *so, bfd *abfd)
       if (dyninfo_sect == NULL)
        goto set_addr;
 
-      dynaddr = bfd_section_vma (abfd, dyninfo_sect);
+      dynaddr = bfd_section_vma (dyninfo_sect);
 
       if (dynaddr + l_addr != l_dynaddr)
        {
@@ -559,7 +559,7 @@ find_program_interpreter (void)
      interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
      if (interp_sect != NULL)
       {
-       int sect_size = bfd_section_size (exec_bfd, interp_sect);
+       int sect_size = bfd_section_size (interp_sect);
 
        gdb::byte_vector buf (sect_size);
        bfd_get_section_contents (exec_bfd, interp_sect, buf.data (), 0,
@@ -618,12 +618,12 @@ scan_dyntag (const int desired_dyntag, bfd *abfd, CORE_ADDR *ptr,
         such fallback to the file VMA address without the possibility of
         having the section relocated to its actual in-memory address.  */
 
-      dyn_addr = bfd_section_vma (abfd, sect);
+      dyn_addr = bfd_section_vma (sect);
     }
 
   /* Read in .dynamic from the BFD.  We will get the actual value
      from memory later.  */
-  sect_size = bfd_section_size (abfd, sect);
+  sect_size = bfd_section_size (sect);
   buf = bufstart = (gdb_byte *) alloca (sect_size);
   if (!bfd_get_section_contents (abfd, sect,
                                 buf, 0, sect_size))
@@ -2255,20 +2255,18 @@ enable_break (struct svr4_info *info, int from_tty)
          interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
          if (interp_sect)
            {
-             info->interp_text_sect_low =
-               bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
-             info->interp_text_sect_high =
-               info->interp_text_sect_low
-               + bfd_section_size (tmp_bfd, interp_sect);
+             info->interp_text_sect_low
+               = bfd_section_vma (interp_sect) + load_addr;
+             info->interp_text_sect_high
+               = info->interp_text_sect_low + bfd_section_size (interp_sect);
            }
          interp_sect = bfd_get_section_by_name (tmp_bfd, ".plt");
          if (interp_sect)
            {
-             info->interp_plt_sect_low =
-               bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
-             info->interp_plt_sect_high =
-               info->interp_plt_sect_low
-               + bfd_section_size (tmp_bfd, interp_sect);
+             info->interp_plt_sect_low
+               = bfd_section_vma (interp_sect) + load_addr;
+             info->interp_plt_sect_high
+               = info->interp_plt_sect_low + bfd_section_size (interp_sect);
            }
 
          svr4_create_solib_event_breakpoints (info, target_gdbarch (), sym_addr);
@@ -2392,20 +2390,18 @@ enable_break (struct svr4_info *info, int from_tty)
       interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".text");
       if (interp_sect)
        {
-         info->interp_text_sect_low =
-           bfd_section_vma (tmp_bfd.get (), interp_sect) + load_addr;
-         info->interp_text_sect_high =
-           info->interp_text_sect_low
-           + bfd_section_size (tmp_bfd.get (), interp_sect);
+         info->interp_text_sect_low
+           = bfd_section_vma (interp_sect) + load_addr;
+         info->interp_text_sect_high
+           = info->interp_text_sect_low + bfd_section_size (interp_sect);
        }
       interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".plt");
       if (interp_sect)
        {
-         info->interp_plt_sect_low =
-           bfd_section_vma (tmp_bfd.get (), interp_sect) + load_addr;
-         info->interp_plt_sect_high =
-           info->interp_plt_sect_low
-           + bfd_section_size (tmp_bfd.get (), interp_sect);
+         info->interp_plt_sect_low
+           = bfd_section_vma (interp_sect) + load_addr;
+         info->interp_plt_sect_high
+           = info->interp_plt_sect_low + bfd_section_size (interp_sect);
        }
 
       /* Now try to set a breakpoint in the dynamic linker.  */
@@ -2733,7 +2729,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
                      gdb_byte *buf_filesz_p = (gdb_byte *) &phdrp->p_filesz;
                      CORE_ADDR filesz;
 
-                     content2 = (bfd_get_section_flags (exec_bfd, plt2_asect)
+                     content2 = (bfd_section_flags (plt2_asect)
                                  & SEC_HAS_CONTENTS) != 0;
 
                      filesz = extract_unsigned_integer (buf_filesz_p, 4,
@@ -2742,9 +2738,9 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
                      /* PLT2_ASECT is from on-disk file (exec_bfd) while
                         FILESZ is from the in-memory image.  */
                      if (content2)
-                       filesz += bfd_get_section_size (plt2_asect);
+                       filesz += bfd_section_size (plt2_asect);
                      else
-                       filesz -= bfd_get_section_size (plt2_asect);
+                       filesz -= bfd_section_size (plt2_asect);
 
                      store_unsigned_integer (buf_filesz_p, 4, byte_order,
                                              filesz);
@@ -2867,7 +2863,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
                      gdb_byte *buf_filesz_p = (gdb_byte *) &phdrp->p_filesz;
                      CORE_ADDR filesz;
 
-                     content2 = (bfd_get_section_flags (exec_bfd, plt2_asect)
+                     content2 = (bfd_section_flags (plt2_asect)
                                  & SEC_HAS_CONTENTS) != 0;
 
                      filesz = extract_unsigned_integer (buf_filesz_p, 8,
@@ -2876,9 +2872,9 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
                      /* PLT2_ASECT is from on-disk file (exec_bfd) while
                         FILESZ is from the in-memory image.  */
                      if (content2)
-                       filesz += bfd_get_section_size (plt2_asect);
+                       filesz += bfd_section_size (plt2_asect);
                      else
-                       filesz -= bfd_get_section_size (plt2_asect);
+                       filesz -= bfd_section_size (plt2_asect);
 
                      store_unsigned_integer (buf_filesz_p, 8, byte_order,
                                              filesz);
@@ -2972,8 +2968,7 @@ svr4_relocate_main_executable (void)
 
       for (asect = exec_bfd->sections; asect != NULL; asect = asect->next)
        exec_set_section_address (bfd_get_filename (exec_bfd), asect->index,
-                                 (bfd_section_vma (exec_bfd, asect)
-                                  + displacement));
+                                 bfd_section_vma (asect) + displacement);
     }
 }
 
index 1ccbc27b2bce09a9a81cde4b7759188f63c7a04a..3fd180850c14cf0ae8fc151b94966772c4968a8d 100644 (file)
@@ -323,7 +323,7 @@ solib_target_relocate_section_addresses (struct so_list *so,
          for (i = 0, sect = so->abfd->sections;
               sect != NULL;
               i++, sect = sect->next)
-           if ((bfd_get_section_flags (so->abfd, sect) & SEC_ALLOC))
+           if ((bfd_section_flags (sect) & SEC_ALLOC))
              num_alloc_sections++;
 
          if (num_alloc_sections != li->section_bases.size ())
@@ -341,14 +341,14 @@ Could not relocate shared library \"%s\": wrong number of ALLOC sections"),
                   sect != NULL;
                   i++, sect = sect->next)
                {
-                 if (!(bfd_get_section_flags (so->abfd, sect) & SEC_ALLOC))
+                 if (!(bfd_section_flags (sect) & SEC_ALLOC))
                    continue;
-                 if (bfd_section_size (so->abfd, sect) > 0)
+                 if (bfd_section_size (sect) > 0)
                    {
                      CORE_ADDR low, high;
 
                      low = li->section_bases[i];
-                     high = low + bfd_section_size (so->abfd, sect) - 1;
+                     high = low + bfd_section_size (sect) - 1;
 
                      if (low < so->addr_low)
                        so->addr_low = low;
index 9dbb6337344fda981c8c9b372f3e65eab68904f2..635366b4f1d4ccbbe8d53f4861dd2a43d4f0c975 100644 (file)
@@ -363,7 +363,7 @@ spu_bfd_open (ULONGEST addr)
   spu_name = bfd_get_section_by_name (nbfd.get (), ".note.spu_name");
   if (spu_name)
     {
-      int sect_size = bfd_section_size (nbfd.get (), spu_name);
+      int sect_size = bfd_section_size (spu_name);
       if (sect_size > 20)
        {
          char *buf = (char *)alloca (sect_size - 20 + 1);
index d01f3af30093bce5eb464e890a2817d542907fce..5360efb12f7da299f9dcf4f3f71b7992f8e0feaf 100644 (file)
@@ -1833,7 +1833,7 @@ spu_get_overlay_table (struct objfile *objfile)
        continue;
 
       ALL_OBJFILE_OSECTIONS (objfile, osect)
-       if (vma == bfd_section_vma (objfile->obfd, osect->the_bfd_section)
+       if (vma == bfd_section_vma (osect->the_bfd_section)
            && pos == osect->the_bfd_section->filepos)
          {
            int ndx = osect - objfile->sections;
@@ -1921,9 +1921,9 @@ spu_overlay_new_objfile (struct objfile *objfile)
       int ndx = osect - objfile->sections;
 
       if (ovly_table[ndx].mapped_ptr == 0)
-       bfd_section_lma (obfd, bsect) = bfd_section_vma (obfd, bsect);
+       bfd_set_section_lma (bsect, bfd_section_vma (bsect));
       else
-       bfd_section_lma (obfd, bsect) = SPU_OVERLAY_LMA + bsect->filepos;
+       bfd_set_section_lma (bsect, SPU_OVERLAY_LMA + bsect->filepos);
     }
 }
 
index 05542c13915cbe1fb269353a79b5737c418e5983..82fb17ed1654f7688fd75de0706b9ef38af3065e 100644 (file)
@@ -111,9 +111,9 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr,
 
   section_addr_info sai;
   for (sec = nbfd->sections; sec != NULL; sec = sec->next)
-    if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
-      sai.emplace_back (bfd_get_section_vma (nbfd, sec) + loadbase,
-                       bfd_get_section_name (nbfd, sec),
+    if ((bfd_section_flags (sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
+      sai.emplace_back (bfd_section_vma (sec) + loadbase,
+                       bfd_section_name (sec),
                        sec->index);
 
   if (from_tty)
index 5252c727aa5bc705d826539b1677db82eb6a8ae0..b914b05a1754547b3376d1de2613e821f3b7cd41 100644 (file)
@@ -200,15 +200,14 @@ find_lowest_section (bfd *abfd, asection *sect, void *obj)
 {
   asection **lowest = (asection **) obj;
 
-  if (0 == (bfd_get_section_flags (abfd, sect) & (SEC_ALLOC | SEC_LOAD)))
+  if (0 == (bfd_section_flags (sect) & (SEC_ALLOC | SEC_LOAD)))
     return;
   if (!*lowest)
     *lowest = sect;            /* First loadable section */
-  else if (bfd_section_vma (abfd, *lowest) > bfd_section_vma (abfd, sect))
+  else if (bfd_section_vma (*lowest) > bfd_section_vma (sect))
     *lowest = sect;            /* A lower loadable section */
-  else if (bfd_section_vma (abfd, *lowest) == bfd_section_vma (abfd, sect)
-          && (bfd_section_size (abfd, (*lowest))
-              <= bfd_section_size (abfd, sect)))
+  else if (bfd_section_vma (*lowest) == bfd_section_vma (sect)
+          && (bfd_section_size (*lowest) <= bfd_section_size (sect)))
     *lowest = sect;
 }
 
@@ -228,10 +227,10 @@ build_section_addr_info_from_section_table (const struct target_section *start,
       struct bfd_section *asect = stp->the_bfd_section;
       bfd *abfd = asect->owner;
 
-      if (bfd_get_section_flags (abfd, asect) & (SEC_ALLOC | SEC_LOAD)
+      if (bfd_section_flags (asect) & (SEC_ALLOC | SEC_LOAD)
          && sap.size () < end - start)
        sap.emplace_back (stp->addr,
-                         bfd_section_name (abfd, asect),
+                         bfd_section_name (asect),
                          gdb_bfd_section_index (abfd, asect));
     }
 
@@ -247,9 +246,9 @@ build_section_addr_info_from_bfd (bfd *abfd)
 
   section_addr_info sap;
   for (sec = abfd->sections; sec != NULL; sec = sec->next)
-    if (bfd_get_section_flags (abfd, sec) & (SEC_ALLOC | SEC_LOAD))
-      sap.emplace_back (bfd_get_section_vma (abfd, sec),
-                       bfd_get_section_name (abfd, sec),
+    if (bfd_section_flags (sec) & (SEC_ALLOC | SEC_LOAD))
+      sap.emplace_back (bfd_section_vma (sec),
+                       bfd_section_name (sec),
                        gdb_bfd_section_index (abfd, sec));
 
   return sap;
@@ -353,10 +352,10 @@ place_section (bfd *abfd, asection *sect, void *obj)
   struct place_section_arg *arg = (struct place_section_arg *) obj;
   CORE_ADDR *offsets = arg->offsets->offsets, start_addr;
   int done;
-  ULONGEST align = ((ULONGEST) 1) << bfd_get_section_alignment (abfd, sect);
+  ULONGEST align = ((ULONGEST) 1) << bfd_section_alignment (sect);
 
   /* We are only interested in allocated sections.  */
-  if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+  if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
     return;
 
   /* If the user specified an offset, honor it.  */
@@ -380,7 +379,7 @@ place_section (bfd *abfd, asection *sect, void *obj)
          continue;
 
        /* We can only conflict with allocated sections.  */
-       if ((bfd_get_section_flags (abfd, cur_sec) & SEC_ALLOC) == 0)
+       if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
          continue;
 
        /* If the section offset is 0, either the section has not been placed
@@ -390,10 +389,10 @@ place_section (bfd *abfd, asection *sect, void *obj)
          continue;
 
        /* If this section would overlap us, then we must move up.  */
-       if (start_addr + bfd_get_section_size (sect) > offsets[indx]
-           && start_addr < offsets[indx] + bfd_get_section_size (cur_sec))
+       if (start_addr + bfd_section_size (sect) > offsets[indx]
+           && start_addr < offsets[indx] + bfd_section_size (cur_sec))
          {
-           start_addr = offsets[indx] + bfd_get_section_size (cur_sec);
+           start_addr = offsets[indx] + bfd_section_size (cur_sec);
            start_addr = (start_addr + align - 1) & -align;
            done = 0;
            break;
@@ -405,7 +404,7 @@ place_section (bfd *abfd, asection *sect, void *obj)
   while (!done);
 
   offsets[gdb_bfd_section_index (abfd, sect)] = start_addr;
-  arg->lowest = start_addr + bfd_get_section_size (sect);
+  arg->lowest = start_addr + bfd_section_size (sect);
 }
 
 /* Store section_addr_info as prepared (made relative and with SECTINDEX
@@ -510,7 +509,7 @@ addr_info_make_relative (section_addr_info *addrs, bfd *abfd)
       lower_offset = 0;
     }
   else
-    lower_offset = bfd_section_vma (bfd_get_filename (abfd), lower_sect);
+    lower_offset = bfd_section_vma (lower_sect);
 
   /* Create ADDRS_TO_ABFD_ADDRS array to map the sections in ADDRS to sections
      in ABFD.  Section names are not unique - there can be multiple sections of
@@ -658,7 +657,7 @@ default_symfile_offsets (struct objfile *objfile,
       for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
        /* We do not expect this to happen; just skip this step if the
           relocatable file has a section with an assigned VMA.  */
-       if (bfd_section_vma (abfd, cur_sec) != 0)
+       if (bfd_section_vma (cur_sec) != 0)
          break;
 
       if (cur_sec == NULL)
@@ -700,10 +699,10 @@ default_symfile_offsets (struct objfile *objfile,
          for (cur_sec = abfd->sections; cur_sec != NULL;
               cur_sec = cur_sec->next)
            {
-             if ((bfd_get_section_flags (abfd, cur_sec) & SEC_ALLOC) == 0)
+             if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
                continue;
 
-             bfd_set_section_vma (abfd, cur_sec, offsets[cur_sec->index]);
+             bfd_set_section_vma (cur_sec, offsets[cur_sec->index]);
              exec_set_section_address (bfd_get_filename (abfd),
                                        cur_sec->index,
                                        offsets[cur_sec->index]);
@@ -740,7 +739,7 @@ default_symfile_segments (bfd *abfd)
   /* Make sure there is at least one loadable section in the file.  */
   for (sect = abfd->sections; sect != NULL; sect = sect->next)
     {
-      if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+      if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
        continue;
 
       break;
@@ -748,8 +747,8 @@ default_symfile_segments (bfd *abfd)
   if (sect == NULL)
     return NULL;
 
-  low = bfd_get_section_vma (abfd, sect);
-  high = low + bfd_get_section_size (sect);
+  low = bfd_section_vma (sect);
+  high = low + bfd_section_size (sect);
 
   data = XCNEW (struct symfile_segment_data);
   data->num_segments = 1;
@@ -763,14 +762,14 @@ default_symfile_segments (bfd *abfd)
     {
       CORE_ADDR vma;
 
-      if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+      if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
        continue;
 
-      vma = bfd_get_section_vma (abfd, sect);
+      vma = bfd_section_vma (sect);
       if (vma < low)
        low = vma;
-      if (vma + bfd_get_section_size (sect) > high)
-       high = vma + bfd_get_section_size (sect);
+      if (vma + bfd_section_size (sect) > high)
+       high = vma + bfd_section_size (sect);
 
       data->segment_info[i] = 1;
     }
@@ -872,9 +871,9 @@ init_entry_point_info (struct objfile *objfile)
        {
          struct bfd_section *sect = osect->the_bfd_section;
 
-         if (entry_point >= bfd_get_section_vma (objfile->obfd, sect)
-             && entry_point < (bfd_get_section_vma (objfile->obfd, sect)
-                               + bfd_get_section_size (sect)))
+         if (entry_point >= bfd_section_vma (sect)
+             && entry_point < (bfd_section_vma (sect)
+                               + bfd_section_size (sect)))
            {
              ei->the_bfd_section_index
                = gdb_bfd_section_index (objfile->obfd, sect);
@@ -1878,7 +1877,7 @@ add_section_size_callback (bfd *abfd, asection *asec, void *data)
 {
   bfd_size_type *sum = (bfd_size_type *) data;
 
-  *sum += bfd_get_section_size (asec);
+  *sum += bfd_section_size (asec);
 }
 
 /* Opaque data for load_progress.  */
@@ -2001,16 +2000,16 @@ static void
 load_section_callback (bfd *abfd, asection *asec, void *data)
 {
   struct load_section_data *args = (struct load_section_data *) data;
-  bfd_size_type size = bfd_get_section_size (asec);
-  const char *sect_name = bfd_get_section_name (abfd, asec);
+  bfd_size_type size = bfd_section_size (asec);
+  const char *sect_name = bfd_section_name (asec);
 
-  if ((bfd_get_section_flags (abfd, asec) & SEC_LOAD) == 0)
+  if ((bfd_section_flags (asec) & SEC_LOAD) == 0)
     return;
 
   if (size == 0)
     return;
 
-  ULONGEST begin = bfd_section_lma (abfd, asec) + args->load_offset;
+  ULONGEST begin = bfd_section_lma (asec) + args->load_offset;
   ULONGEST end = begin + size;
   gdb_byte *buffer = (gdb_byte *) xmalloc (size);
   bfd_get_section_contents (abfd, asec, buffer, 0, size);
@@ -2988,9 +2987,8 @@ section_is_overlay (struct obj_section *section)
     {
       asection *bfd_section = section->the_bfd_section;
 
-      if (bfd_section_lma (abfd, bfd_section) != 0
-         && bfd_section_lma (abfd, bfd_section)
-            != bfd_section_vma (abfd, bfd_section))
+      if (bfd_section_lma (bfd_section) != 0
+         && bfd_section_lma (bfd_section) != bfd_section_vma (bfd_section))
        return 1;
     }
 
@@ -3061,15 +3059,14 @@ pc_in_unmapped_range (CORE_ADDR pc, struct obj_section *section)
 {
   if (section_is_overlay (section))
     {
-      bfd *abfd = section->objfile->obfd;
       asection *bfd_section = section->the_bfd_section;
 
       /* We assume the LMA is relocated by the same offset as the VMA.  */
-      bfd_vma size = bfd_get_section_size (bfd_section);
+      bfd_vma size = bfd_section_size (bfd_section);
       CORE_ADDR offset = obj_section_offset (section);
 
-      if (bfd_get_section_lma (abfd, bfd_section) + offset <= pc
-         && pc < bfd_get_section_lma (abfd, bfd_section) + offset + size)
+      if (bfd_section_lma (bfd_section) + offset <= pc
+         && pc < bfd_section_lma (bfd_section) + offset + size)
        return 1;
     }
 
@@ -3117,8 +3114,8 @@ overlay_unmapped_address (CORE_ADDR pc, struct obj_section *section)
     {
       asection *bfd_section = section->the_bfd_section;
 
-      return pc + bfd_section_lma (abfd, bfd_section)
-               - bfd_section_vma (abfd, bfd_section);
+      return (pc + bfd_section_lma (bfd_section)
+             - bfd_section_vma (bfd_section));
     }
 
   return pc;
@@ -3135,8 +3132,8 @@ overlay_mapped_address (CORE_ADDR pc, struct obj_section *section)
     {
       asection *bfd_section = section->the_bfd_section;
 
-      return pc + bfd_section_vma (abfd, bfd_section)
-               - bfd_section_lma (abfd, bfd_section);
+      return (pc + bfd_section_vma (bfd_section)
+             - bfd_section_lma (bfd_section));
     }
 
   return pc;
@@ -3241,10 +3238,10 @@ list_overlays_command (const char *args, int from_tty)
              bfd_vma lma, vma;
              int size;
 
-             vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
-             lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
-             size = bfd_get_section_size (osect->the_bfd_section);
-             name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
+             vma = bfd_section_vma (osect->the_bfd_section);
+             lma = bfd_section_lma (osect->the_bfd_section);
+             size = bfd_section_size (osect->the_bfd_section);
+             name = bfd_section_name (osect->the_bfd_section);
 
              printf_filtered ("Section %s, loaded at ", name);
              fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
@@ -3282,8 +3279,7 @@ map_overlay_command (const char *args, int from_tty)
   /* First, find a section matching the user supplied argument.  */
   for (objfile *obj_file : current_program_space->objfiles ())
     ALL_OBJFILE_OSECTIONS (obj_file, sec)
-      if (!strcmp (bfd_section_name (obj_file->obfd, sec->the_bfd_section),
-                  args))
+      if (!strcmp (bfd_section_name (sec->the_bfd_section), args))
        {
          /* Now, check to see if the section is an overlay.  */
          if (!section_is_overlay (sec))
@@ -3301,8 +3297,7 @@ map_overlay_command (const char *args, int from_tty)
                {
                  if (info_verbose)
                    printf_unfiltered (_("Note: section %s unmapped by overlap\n"),
-                                      bfd_section_name (obj_file->obfd,
-                                                        sec2->the_bfd_section));
+                                      bfd_section_name (sec2->the_bfd_section));
                  sec2->ovly_mapped = 0; /* sec2 overlaps sec: unmap sec2.  */
                }
          return;
@@ -3330,7 +3325,7 @@ unmap_overlay_command (const char *args, int from_tty)
   /* First, find a section matching the user supplied argument.  */
   for (objfile *objfile : current_program_space->objfiles ())
     ALL_OBJFILE_OSECTIONS (objfile, sec)
-      if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
+      if (!strcmp (bfd_section_name (sec->the_bfd_section), args))
        {
          if (!sec->ovly_mapped)
            error (_("Section %s is not mapped"), args);
@@ -3539,14 +3534,14 @@ simple_overlay_update_1 (struct obj_section *osect)
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   for (i = 0; i < cache_novlys; i++)
-    if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
-       && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect))
+    if (cache_ovly_table[i][VMA] == bfd_section_vma (bsect)
+       && cache_ovly_table[i][LMA] == bfd_section_lma (bsect))
       {
        read_target_long_array (cache_ovly_table_base + i * word_size,
                                (unsigned int *) cache_ovly_table[i],
                                4, word_size, byte_order);
-       if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
-           && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect))
+       if (cache_ovly_table[i][VMA] == bfd_section_vma (bsect)
+           && cache_ovly_table[i][LMA] == bfd_section_lma (bsect))
          {
            osect->ovly_mapped = cache_ovly_table[i][MAPPED];
            return 1;
@@ -3607,8 +3602,8 @@ simple_overlay_update (struct obj_section *osect)
          asection *bsect = osect->the_bfd_section;
 
          for (i = 0; i < cache_novlys; i++)
-           if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
-               && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect))
+           if (cache_ovly_table[i][VMA] == bfd_section_vma (bsect)
+               && cache_ovly_table[i][LMA] == bfd_section_lma (bsect))
              { /* obj_section matches i'th entry in ovly_table.  */
                osect->ovly_mapped = cache_ovly_table[i][MAPPED];
                break;          /* finished with inner for loop: break out.  */
index 7666de390cd58e02123ba756b6ea06d3a0a83569..4699fd09206e06c4ce569a3c40d84f86635043a6 100644 (file)
@@ -244,8 +244,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
        {
          if (section->the_bfd_section != NULL)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (objfile->obfd,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          else
            fprintf_filtered (outfile, " spurious section %ld",
                              (long) (section - objfile->sections));
@@ -525,8 +524,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                      outfile);
       if (section)
        fprintf_filtered (outfile, " section %s\n",
-                         bfd_section_name (section->the_bfd_section->owner,
-                                           section->the_bfd_section));
+                         bfd_section_name (section->the_bfd_section));
       else
        fprintf_filtered (outfile, "\n");
       return;
@@ -596,8 +594,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                          outfile);
          if (section)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (section->the_bfd_section->owner,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          break;
 
        case LOC_REGISTER:
@@ -638,8 +635,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                          outfile);
          if (section)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (section->the_bfd_section->owner,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          break;
 
        case LOC_BLOCK:
@@ -655,8 +651,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                          outfile);
          if (section)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (section->the_bfd_section->owner,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          break;
 
        case LOC_COMPUTED:
index e2edad4fb1119c05120c222f375e614f481a1fd9..35eab08cb37c381dd6a3ee6c24d842c979f8a779 100644 (file)
@@ -1033,20 +1033,17 @@ matching_obj_sections (struct obj_section *obj_first,
      have the same size, address, and name.  We can't compare section indexes,
      which would be more reliable, because some sections may have been
      stripped.  */
-  if (bfd_get_section_size (first) != bfd_get_section_size (second))
+  if (bfd_section_size (first) != bfd_section_size (second))
     return 0;
 
   /* In-memory addresses may start at a different offset, relativize them.  */
-  if (bfd_get_section_vma (first->owner, first)
-      - bfd_get_start_address (first->owner)
-      != bfd_get_section_vma (second->owner, second)
-        - bfd_get_start_address (second->owner))
+  if (bfd_section_vma (first) - bfd_get_start_address (first->owner)
+      != bfd_section_vma (second) - bfd_get_start_address (second->owner))
     return 0;
 
-  if (bfd_get_section_name (first->owner, first) == NULL
-      || bfd_get_section_name (second->owner, second) == NULL
-      || strcmp (bfd_get_section_name (first->owner, first),
-                bfd_get_section_name (second->owner, second)) != 0)
+  if (bfd_section_name (first) == NULL
+      || bfd_section_name (second) == NULL
+      || strcmp (bfd_section_name (first), bfd_section_name (second)) != 0)
     return 0;
 
   /* Otherwise check that they are in corresponding objfiles.  */
index 599e22a724ceddbcd96deeeb5fac146505dbcbc8..78bdfeb49a4a034a7a51f1b19cd044fac5d383a7 100644 (file)
@@ -1042,9 +1042,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
 
       secp = target_section_by_addr (ops, memaddr);
       if (secp != NULL
-         && (bfd_get_section_flags (secp->the_bfd_section->owner,
-                                    secp->the_bfd_section)
-             & SEC_READONLY))
+         && (bfd_section_flags (secp->the_bfd_section) & SEC_READONLY))
        {
          table = target_get_section_table (ops);
          return section_table_xfer_memory_partial (readbuf, writebuf,
index c4fde913af33bae7affd26a6ecc16362a02f8a1a..26030e0a9285ca947df24f7f8f239afb4bac54f4 100644 (file)
@@ -794,8 +794,7 @@ windows_make_so (const char *name, LPVOID load_addr)
         file header and the section alignment.  */
       cygwin_load_start = (CORE_ADDR) (uintptr_t) ((char *)
                                                   load_addr + 0x1000);
-      cygwin_load_end = cygwin_load_start + bfd_section_size (abfd.get (),
-                                                             text);
+      cygwin_load_end = cygwin_load_start + bfd_section_size (text);
     }
 #endif
 
index a17031a110e4fa6f7c97a244e27516781844c3d9..2fa27066539caad2597bda37ac5942e13430db6e 100644 (file)
@@ -267,9 +267,9 @@ find_targ_sec (bfd *abfd, asection *sect, void *obj)
   if (sect->target_index == args->targ_index)
     {
       /* This is the section.  Figure out what SECT_OFF_* code it is.  */
-      if (bfd_get_section_flags (abfd, sect) & SEC_CODE)
+      if (bfd_section_flags (sect) & SEC_CODE)
        *args->resultp = SECT_OFF_TEXT (objfile);
-      else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD)
+      else if (bfd_section_flags (sect) & SEC_LOAD)
        *args->resultp = SECT_OFF_DATA (objfile);
       else
        *args->resultp = gdb_bfd_section_index (abfd, sect);
@@ -2354,7 +2354,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                       section.  */
                    bfd_sect = secnum_to_bfd_section (symbol.n_scnum, objfile);
                    if (bfd_sect)
-                     toc_offset -= bfd_section_vma (objfile->obfd, bfd_sect);
+                     toc_offset -= bfd_section_vma (bfd_sect);
                    break;
 
                  case XMC_TC:
@@ -2952,7 +2952,7 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
          secp = bfd_get_section_by_name (abfd, ".debug");
          if (secp)
            {
-             length = bfd_section_size (abfd, secp);
+             length = bfd_section_size (secp);
              if (length)
                {
                  debugsec
@@ -3029,8 +3029,7 @@ xcoff_symfile_offsets (struct objfile *objfile,
   if (objfile->num_sections == 0)
     return; /* Is that even possible?  Better safe than sorry.  */
 
-  first_section_name
-    = bfd_section_name (objfile->obfd, objfile->sections[0].the_bfd_section);
+  first_section_name = bfd_section_name (objfile->sections[0].the_bfd_section);
 
   if (objfile->sect_index_text == 0
       && strcmp (first_section_name, ".text") != 0)
@@ -3089,7 +3088,7 @@ xcoff_get_core_n_import_files (bfd *abfd)
   if (sect == NULL)
     return -1;  /* Not a core file.  */
 
-  for (offset = 0; offset < bfd_get_section_size (sect);)
+  for (offset = 0; offset < bfd_section_size (sect);)
     {
       int next;
 
index a2ebab5e04b4daf21b13ffd4705a1fcbe0081cff..84285aa30de0c1cfa4e16d94b5731ad7722cd995 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * corefile.c, * symtab.c: Update throughout for bfd section
+       macro and function changes.
+
 2019-09-18  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * Makefile.in: Re-generate.
index 3f350f5f6b2bd6c756868b3d03c226076000ad1b..ba6fd9c54f2d2e2087d58c7541d1a691b1898d8d 100644 (file)
@@ -271,17 +271,17 @@ core_init (const char * aout_name)
 void
 core_get_text_space (bfd *cbfd)
 {
-  core_text_space = malloc (bfd_get_section_size (core_text_sect));
+  core_text_space = malloc (bfd_section_size (core_text_sect));
 
   if (!core_text_space)
     {
       fprintf (stderr, _("%s: ran out room for %lu bytes of text space\n"),
-              whoami, (unsigned long) bfd_get_section_size (core_text_sect));
+              whoami, (unsigned long) bfd_section_size (core_text_sect));
       done (1);
     }
 
   if (!bfd_get_section_contents (cbfd, core_text_sect, core_text_space,
-                                0, bfd_get_section_size (core_text_sect)))
+                                0, bfd_section_size (core_text_sect)))
     {
       bfd_perror ("bfd_get_section_contents");
       free (core_text_space);
@@ -675,7 +675,7 @@ core_create_function_syms (void)
       sym_sec = core_syms[i]->section;
       symtab.limit->addr = core_syms[i]->value;
       if (sym_sec)
-       symtab.limit->addr += bfd_get_section_vma (sym_sec->owner, sym_sec);
+       symtab.limit->addr += bfd_section_vma (sym_sec);
 
       if (found)
        {
@@ -734,8 +734,8 @@ core_create_function_syms (void)
         section containing the symbol, if available.  */
       min_vma = MIN (symtab.limit->addr, min_vma);
       if (sym_sec)
-       max_vma = MAX (bfd_get_section_vma (sym_sec->owner, sym_sec)
-                      + bfd_section_size (sym_sec->owner, sym_sec) - 1,
+       max_vma = MAX (bfd_section_vma (sym_sec)
+                      + bfd_section_size (sym_sec) - 1,
                       max_vma);
       else
        max_vma = MAX (symtab.limit->addr, max_vma);
@@ -787,7 +787,7 @@ core_create_line_syms (void)
   ltab.len = 0;
   prev_line_num = 0;
 
-  vma_high = core_text_sect->vma + bfd_get_section_size (core_text_sect);
+  vma_high = core_text_sect->vma + bfd_section_size (core_text_sect);
   for (vma = core_text_sect->vma; vma < vma_high; vma += min_insn_size)
     {
       unsigned int len;
index 70eb41573bca55a693056d98a6d6c1e01a2588b2..eb63aa926a29e1267c06bb2cb46d9598330cefd2 100644 (file)
@@ -149,7 +149,7 @@ symtab_finalize (Sym_Table *tab)
 
   if (tab->len > 0 && dst[-1].end_addr == 0)
     dst[-1].end_addr
-      = core_text_sect->vma + bfd_get_section_size (core_text_sect) - 1;
+      = core_text_sect->vma + bfd_section_size (core_text_sect) - 1;
 
   DBG (AOUTDEBUG | IDDEBUG,
        printf ("[symtab_finalize]: removed %d duplicate entries\n",
index e8f9ed736590ab51ffb0584d036e33af1efaf89d..2abb558b9c1e11c118ababb2bf4f090881f26d68 100644 (file)
@@ -1,3 +1,16 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2019-09-18  Alan Modra  <amodra@gmail.com>
 
        * ldcref.c (check_reloc_refs): Update bfd_get_section to
index 7ffb17e7a9cd87640a0a50d1e3dfbf3b1a442d9c..bd5c888782650bed8d0e1be425b880975f09797c 100644 (file)
@@ -178,7 +178,7 @@ elf${ELFSIZE}_aarch64_add_stub_section (const char *stub_sec_name,
 
   /* Long branch stubs contain a 64-bit address, so the section requires
      8 byte alignment.  */
-  bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
+  bfd_set_section_alignment (stub_sec, 3);
 
   output_section = input_section->output_section;
   os = lang_output_section_get (output_section);
index 8151a9d5e93bf0db5d40fc22a43076f8c14508ec..1ce8376a52a4457ee549e1af7463c43354523df6 100644 (file)
@@ -895,7 +895,7 @@ gld${EMULATION_NAME}_before_allocation (void)
       if (is == NULL)
        {
          einfo (_("%F%P: can't find %s in output section\n"),
-                bfd_get_section_name (sec->owner, sec));
+                bfd_section_name (sec));
        }
 
       /* Now figure out where the section should go.  */
index 20122aa03f93befb1053b9ffd70c666d93db33df..180e1faa27c296deff1987c8478f2beb757dcbfb 100644 (file)
@@ -176,8 +176,7 @@ gld${EMULATION_NAME}_finish (void)
          /* Special procesing is required for a Thumb entry symbol.  The
             bottom bit of its address must be set.  */
          val = (h->u.def.value
-                + bfd_get_section_vma (link_info.output_bfd,
-                                       h->u.def.section->output_section)
+                + bfd_section_vma (h->u.def.section->output_section)
                 + h->u.def.section->output_offset);
 
          val |= 1;
index bb32bbbda419b6c44a48a3e0a06c2a5d2466a98b..0cbfcc70b320ddfa46b492778a59921e8016cb61 100644 (file)
@@ -232,7 +232,7 @@ elf32_arm_add_stub_section (const char * stub_sec_name,
   if (stub_sec == NULL)
     goto err_ret;
 
-  bfd_set_section_alignment (stub_file->the_bfd, stub_sec, alignment_power);
+  bfd_set_section_alignment (stub_sec, alignment_power);
 
   os = lang_output_section_get (output_section);
 
@@ -478,8 +478,7 @@ gld${EMULATION_NAME}_finish (void)
       /* Special procesing is required for a Thumb entry symbol.  The
         bottom bit of its address must be set.  */
       val = (h->u.def.value
-            + bfd_get_section_vma (link_info.output_bfd,
-                                   h->u.def.section->output_section)
+            + bfd_section_vma (h->u.def.section->output_section)
             + h->u.def.section->output_offset);
 
       val |= 1;
index 197f0c6391f90c7395cb0c4abeb4a63a5fa2c7f1..9cdd356e3563395d75e822bc8689ec0d4a9923d5 100644 (file)
@@ -75,14 +75,12 @@ cr16_elf_after_open (void)
 
              relsec = bfd_make_section (abfd, ".emreloc");
              if (relsec == NULL
-                 || ! bfd_set_section_flags (abfd, relsec,
-                                             (SEC_ALLOC
-                                              | SEC_LOAD
-                                              | SEC_HAS_CONTENTS
-                                              | SEC_IN_MEMORY))
-                 || ! bfd_set_section_alignment (abfd, relsec, 2)
-                 || ! bfd_set_section_size (abfd, relsec,
-                                            datasec->reloc_count * 8))
+                 || !bfd_set_section_flags (relsec, (SEC_ALLOC
+                                                     | SEC_LOAD
+                                                     | SEC_HAS_CONTENTS
+                                                     | SEC_IN_MEMORY))
+                 || !bfd_set_section_alignment (relsec, 2)
+                 || !bfd_set_section_size (relsec, datasec->reloc_count * 8))
                einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
            }
 
@@ -99,11 +97,11 @@ cr16_elf_after_open (void)
 static void
 check_sections (bfd *abfd, asection *sec, void *datasec)
 {
-  if ((strncmp (bfd_get_section_name (abfd, sec), ".data.rel", 9) == 0)
+  if ((strncmp (bfd_section_name (sec), ".data.rel", 9) == 0)
       && sec != datasec
       && sec->reloc_count == 0 )
     einfo (_("%X%P: %pB: section %s has relocs; can not use --embedded-relocs\n"),
-          abfd, bfd_get_section_name (abfd, sec));
+          abfd, bfd_section_name (sec));
 }
 
 static void
index 10d037c80d6c6cbeb3bcac9ca58daa9904b0d602..91848086550abff209d3a88f95a8de488d6c6bce 100644 (file)
@@ -180,10 +180,10 @@ elf32_csky_add_stub_section (const char *stub_sec_name,
   if (stub_sec == NULL)
     goto err_ret;
 
-  bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
+  bfd_set_section_alignment (stub_sec, 3);
 
   output_section = input_section->output_section;
-  secname = bfd_get_section_name (output_section->owner, output_section);
+  secname = bfd_section_name (output_section);
   os = lang_output_section_find (secname);
 
   info.input_section = input_section;
index b55989e0e66b4d7b96844420ed3c92a1ac9005b4..b63e4e92d97ff240188513f789cee6694aa7ecec 100644 (file)
@@ -212,10 +212,8 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp)
 
        case lang_input_section_enum:
          if (l->input_section.section == info->input_section
-             || strcmp (bfd_get_section_name (l->input_section.section->owner,
-                                              l->input_section.section),
-                        bfd_get_section_name (info->input_section->owner,
-                                              info->input_section)) == 0)
+             || strcmp (bfd_section_name (l->input_section.section),
+                        bfd_section_name (info->input_section)) == 0)
            {
              /* We've found our section.  Insert the stub immediately
                 before its associated input section.  */
index add8fd21dc1f1f168526d8ab21771517c729bb9f..c8d9eea934b4f50818987d9f083ba484d0175f9b 100644 (file)
@@ -102,9 +102,8 @@ m68k_elf_after_open (void)
                                                    | SEC_HAS_CONTENTS
                                                    | SEC_IN_MEMORY));
              if (relsec == NULL
-                 || ! bfd_set_section_alignment (abfd, relsec, 2)
-                 || ! bfd_set_section_size (abfd, relsec,
-                                            datasec->reloc_count * 12))
+                 || !bfd_set_section_alignment (relsec, 2)
+                 || !bfd_set_section_size (relsec, datasec->reloc_count * 12))
                einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
            }
 
@@ -123,11 +122,11 @@ m68k_elf_after_open (void)
 static void
 check_sections (bfd *abfd, asection *sec, void *datasec)
 {
-  if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
+  if ((bfd_section_flags (sec) & SEC_DATA)
       && sec != datasec
       && sec->reloc_count != 0)
     einfo (_("%X%P: %pB: section %s has relocs; can not use --embedded-relocs\n"),
-          abfd, bfd_get_section_name (abfd, sec));
+          abfd, bfd_section_name (sec));
 }
 
 #endif /* SUPPORT_EMBEDDED_RELOCS */
index 108d33faf3382cef617a0e627da101e7adcb3c22..48944d5309be06e52291f568ef26412f7bc5e7f8 100644 (file)
@@ -168,7 +168,7 @@ mips_add_stub_section (const char *stub_sec_name, asection *input_section,
   /* Set the flags.  */
   flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
           | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_KEEP);
-  if (!bfd_set_section_flags (stub_bfd, stub_sec, flags))
+  if (!bfd_set_section_flags (stub_sec, flags))
     goto err_ret;
 
   os = lang_output_section_get (output_section);
index 736988b0cfffe1000ba3b4f9a7e3ee731be00ea5..7cb4087a935f200d0ad2f05ad4fd96aaa5ce2a63 100644 (file)
@@ -103,14 +103,14 @@ mmix_after_allocation (void)
     }
 
   /* Set vma to correspond to first such register number * 8.  */
-  bfd_set_section_vma (link_info.output_bfd, sec, (bfd_vma) regvma);
+  bfd_set_section_vma (sec, (bfd_vma) regvma);
 
   /* Simplify symbol output for the register section (without contents;
      created for register symbols) by setting the output offset to 0.
      This section is only present when there are register symbols.  */
   sec = bfd_get_section_by_name (link_info.output_bfd, MMIX_REG_SECTION_NAME);
   if (sec != NULL)
-    bfd_set_section_vma (sec->owner, sec, 0);
+    bfd_set_section_vma (sec, 0);
 
   if (!_bfd_mmix_after_linker_allocation (link_info.output_bfd, &link_info))
     {
index 62ee144416be39005aa665bfa2b2fb21fdb459ce..fff48942bc43349f63724d31b67bd39d51b970ee 100644 (file)
@@ -192,10 +192,10 @@ mmo_place_orphan (asection *s,
    paper over the bug similarly.  */
 
 static void
-mmo_wipe_sec_reloc_flag (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
+mmo_wipe_sec_reloc_flag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
+                        void *ptr ATTRIBUTE_UNUSED)
 {
-  bfd_set_section_flags (abfd, sec,
-                        bfd_get_section_flags (abfd, sec) & ~SEC_RELOC);
+  bfd_set_section_flags (sec, bfd_section_flags (sec) & ~SEC_RELOC);
 }
 
 /* Iterate with bfd_map_over_sections over mmo_wipe_sec_reloc_flag... */
index 765a9ea288a3b6847cb2625d62f22589e54f7442..8f2548952898183f7ddbb715a1001c994f05370a 100644 (file)
@@ -382,10 +382,10 @@ change_output_section (lang_statement_union_type ** head,
 }
 
 static void
-add_region_prefix (bfd *abfd, asection *s,
-                  ATTRIBUTE_UNUSED void *unused)
+add_region_prefix (bfd *abfd ATTRIBUTE_UNUSED, asection *s,
+                  void *unused ATTRIBUTE_UNUSED)
 {
-  const char *curr_name = bfd_get_section_name (abfd, s);
+  const char *curr_name = bfd_section_name (s);
   int region = REGION_NONE;
 
   if (strncmp (curr_name, ".text", 5) == 0)
@@ -404,10 +404,10 @@ add_region_prefix (bfd *abfd, asection *s,
     case REGION_NONE:
       break;
     case REGION_UPPER:
-      bfd_rename_section (abfd, s, concat (".upper", curr_name, NULL));
+      bfd_rename_section (s, concat (".upper", curr_name, NULL));
       break;
     case REGION_LOWER:
-      bfd_rename_section (abfd, s, concat (".lower", curr_name, NULL));
+      bfd_rename_section (s, concat (".lower", curr_name, NULL));
       break;
     case REGION_EITHER:
       s->name = concat (".either", curr_name, NULL);
@@ -538,7 +538,8 @@ gld${EMULATION_NAME}_handle_option (int optc)
 }
 
 static void
-eval_upper_either_sections (bfd *abfd, asection *s, void *data)
+eval_upper_either_sections (bfd *abfd ATTRIBUTE_UNUSED,
+                           asection *s, void *data)
 {
   const char * base_sec_name;
   const char * curr_name;
@@ -560,7 +561,7 @@ eval_upper_either_sections (bfd *abfd, asection *s, void *data)
     return;
 
   base_sec_name = (const char *) data;
-  curr_name = bfd_get_section_name (abfd, s);
+  curr_name = bfd_section_name (s);
 
   /* Only concerned with .either input sections in the upper output section.  */
   either_name = concat (".either", base_sec_name, NULL);
@@ -620,7 +621,8 @@ eval_upper_either_sections (bfd *abfd, asection *s, void *data)
 }
 
 static void
-eval_lower_either_sections (bfd *abfd, asection *s, void *data)
+eval_lower_either_sections (bfd *abfd ATTRIBUTE_UNUSED,
+                           asection *s, void *data)
 {
   const char * base_sec_name;
   const char * curr_name;
@@ -640,7 +642,7 @@ eval_lower_either_sections (bfd *abfd, asection *s, void *data)
     return;
 
   base_sec_name = (const char *) data;
-  curr_name = bfd_get_section_name (abfd, s);
+  curr_name = bfd_section_name (s);
 
   /* Only concerned with .either input sections in the lower or "default"
      output section i.e. not in the upper output section.  */
index 02eb06fb5781c3a71a8549f646443773d9829086..816da6ca72266594b48f911567b613ab2bc50c78 100644 (file)
@@ -181,7 +181,7 @@ nios2elf_add_stub_section (const char *stub_sec_name, asection *input_section,
     goto err_ret;
 
   output_section = input_section->output_section;
-  secname = bfd_get_section_name (output_section->owner, output_section);
+  secname = bfd_section_name (output_section);
   os = lang_output_section_find (secname);
 
   info.input_section = input_section;
index 2e78f26ad8b1c4e19642bc5fb69d52ba2e81b938..70f771cebd782b608e1aaf83c13241820b34e9a5 100644 (file)
@@ -1920,8 +1920,7 @@ gld_${EMULATION_NAME}_finish (void)
          /* Special procesing is required for a Thumb entry symbol.  The
             bottom bit of its address must be set.  */
          val = (h->u.def.value
-                + bfd_get_section_vma (link_info.output_bfd,
-                                       h->u.def.section->output_section)
+                + bfd_section_vma (h->u.def.section->output_section)
                 + h->u.def.section->output_offset);
 
          val |= 1;
@@ -2182,7 +2181,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
 
       ls = &(*pl)->input_section;
 
-      lname = bfd_get_section_name (ls->section->owner, ls->section);
+      lname = bfd_section_name (ls->section);
       if (strchr (lname, '\$') != NULL
          && (dollar == NULL || strcmp (orig_secname, lname) < 0))
        break;
index 601ef11c2014aaec8bfd7d864f69a78344e00358..6d150d211a92bb725935724c150ef5da9e5cce96 100644 (file)
@@ -1979,7 +1979,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
 
       ls = &(*pl)->input_section;
 
-      lname = bfd_get_section_name (ls->section->owner, ls->section);
+      lname = bfd_section_name (ls->section);
       if (strchr (lname, '\$') != NULL
          && (dollar == NULL || strcmp (orig_secname, lname) < 0))
        break;
index 6df2a20cfceb7352a90b0c4a559974650a86729a..ee71f256c657c2f4cc619362b73b0dddb734c93c 100644 (file)
@@ -421,12 +421,11 @@ ppc_add_stub_section (const char *stub_sec_name, asection *input_section)
   stub_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd,
                                                 stub_sec_name, flags);
   if (stub_sec == NULL
-      || !bfd_set_section_alignment (stub_file->the_bfd, stub_sec,
-                                    (params.plt_stub_align > 5
-                                     ? params.plt_stub_align
-                                     : params.plt_stub_align < -5
-                                     ? -params.plt_stub_align
-                                     : 5)))
+      || !bfd_set_section_alignment (stub_sec, (params.plt_stub_align > 5
+                                               ? params.plt_stub_align
+                                               : params.plt_stub_align < -5
+                                               ? -params.plt_stub_align
+                                               : 5)))
     goto err_ret;
 
   output_section = input_section->output_section;
index c826363f5c9501cf2baf1a34c1ca8d185f89eb05..569df615ce04091150ac18e9aea505443d25ad99 100644 (file)
@@ -127,9 +127,9 @@ replace_insn_sec_with_prop_sec (bfd *abfd,
   /* Create a property table section for it.  */
   prop_sec_name = strdup (prop_sec_name);
   prop_sec = bfd_make_section_with_flags
-    (abfd, prop_sec_name, bfd_get_section_flags (abfd, insn_sec));
+    (abfd, prop_sec_name, bfd_section_flags (insn_sec));
   if (prop_sec == NULL
-      || ! bfd_set_section_alignment (abfd, prop_sec, 2))
+      || !bfd_set_section_alignment (prop_sec, 2))
     {
       *error_message = _("could not create new section");
       goto cleanup;
@@ -247,7 +247,7 @@ replace_instruction_table_sections (bfd *abfd, asection *sec)
   char *owned_prop_sec_name = NULL;
   const char *sec_name;
 
-  sec_name = bfd_get_section_name (abfd, sec);
+  sec_name = bfd_section_name (sec);
   if (strcmp (sec_name, INSN_SEC_BASE_NAME) == 0)
     {
       insn_sec_name = INSN_SEC_BASE_NAME;
@@ -1293,10 +1293,10 @@ static bfd_boolean
 is_inconsistent_linkonce_section (asection *sec)
 {
   bfd *abfd = sec->owner;
-  const char *sec_name = bfd_get_section_name (abfd, sec);
+  const char *sec_name = bfd_section_name (sec);
   const char *name;
 
-  if ((bfd_get_section_flags (abfd, sec) & SEC_LINK_ONCE) == 0
+  if ((bfd_section_flags (sec) & SEC_LINK_ONCE) == 0
       || strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0)
     return FALSE;
 
index fff852a89ab9fd3f09f693b114bbacf495cb044d..576cf7e388fb193c71eef56c33b58596cb9f9381 100644 (file)
@@ -574,7 +574,7 @@ check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED)
   defsec = hl->u.def.section->output_section;
   if (defsec == NULL)
     return TRUE;
-  defsecname = bfd_get_section_name (defsec->owner, defsec);
+  defsecname = bfd_section_name (defsec);
 
   for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next)
     for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next)
@@ -658,10 +658,10 @@ check_reloc_refs (bfd *abfd, asection *sec, void *iarg)
   arelent **p, **pend;
 
   outsec = sec->output_section;
-  outsecname = bfd_get_section_name (outsec->owner, outsec);
+  outsecname = bfd_section_name (outsec);
 
   outdefsec = info->defsec->output_section;
-  outdefsecname = bfd_get_section_name (outdefsec->owner, outdefsec);
+  outdefsecname = bfd_section_name (outdefsec);
 
   /* The section where the symbol is defined is permitted.  */
   if (strcmp (outsecname, outdefsecname) == 0)
index 608ca6c1f359f47410adced98867af981b34f2ee..a6a6aa9e1e0dfefc2d58a47de14ff9ce6ae8fb71 100644 (file)
@@ -293,7 +293,7 @@ ldctor_build_sets (void)
              /* See PR 20911 for a reproducer.  */
              if (p->elements->section->owner == NULL)
                einfo (_("%X%P: special section %s does not support reloc %s for set %s\n"),
-                      bfd_get_section_name (link_info.output_bfd, p->elements->section),
+                      bfd_section_name (p->elements->section),
                       bfd_get_reloc_code_name (p->reloc),
                       p->h->root.string);
              else
index 3b0f3ada8c2b9518d6689f5c103c5aff85374bee..8d4a2e58a1b6c96effc4873d147a259942dca9c1 100644 (file)
@@ -1065,7 +1065,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
 
          for (s = abfd->sections; s && type < COMPACT_EH_HDR; s = s->next)
            {
-             const char *name = bfd_get_section_name (abfd, s);
+             const char *name = bfd_section_name (s);
 
              if (bfd_is_abs_section (s->output_section))
                continue;
@@ -1112,7 +1112,7 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
                                           bed->dynamic_sec_flags
                                           | SEC_READONLY);
          if (s != NULL
-             && bfd_set_section_alignment (elfbfd, s, 2))
+             && bfd_set_section_alignment (s, 2))
            {
              htab->eh_info.hdr_sec = s;
              warn_eh_frame = FALSE;
@@ -1382,7 +1382,7 @@ ldelf_setup_build_id (bfd *ibfd)
   flags = (SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY
           | SEC_LINKER_CREATED | SEC_READONLY | SEC_DATA);
   s = bfd_make_section_with_flags (ibfd, ".note.gnu.build-id", flags);
-  if (s != NULL && bfd_set_section_alignment (ibfd, s, 2))
+  if (s != NULL && bfd_set_section_alignment (s, 2))
     {
       struct elf_obj_tdata *t = elf_tdata (link_info.output_bfd);
       t->o->build_id.after_write_object_contents = &write_build_id;
index 76e862a6409d1d92ef50cc2f507d783ef97c9c05..a3843623fb4beaa5cfaa32fb3af3c15baf841fa9 100644 (file)
@@ -319,7 +319,7 @@ walk_wild_section_general (lang_wild_statement_type *ptr,
 
          if (sec->spec.name != NULL)
            {
-             const char *sname = bfd_get_section_name (file->the_bfd, s);
+             const char *sname = bfd_section_name (s);
 
              skip = name_match (sec->spec.name, sname) != 0;
            }
@@ -452,10 +452,8 @@ compare_section (sort_type sort, asection *asec, asection *bsec)
       abort ();
 
     case by_init_priority:
-      ainit_priority
-       = get_init_priority (bfd_get_section_name (asec->owner, asec));
-      binit_priority
-       = get_init_priority (bfd_get_section_name (bsec->owner, bsec));
+      ainit_priority = get_init_priority (bfd_section_name (asec));
+      binit_priority = get_init_priority (bfd_section_name (bsec));
       if (ainit_priority == 0 || binit_priority == 0)
        goto sort_by_name;
       ret = ainit_priority - binit_priority;
@@ -465,28 +463,24 @@ compare_section (sort_type sort, asection *asec, asection *bsec)
        goto sort_by_name;
 
     case by_alignment_name:
-      ret = (bfd_section_alignment (bsec->owner, bsec)
-            - bfd_section_alignment (asec->owner, asec));
+      ret = bfd_section_alignment (bsec) - bfd_section_alignment (asec);
       if (ret)
        break;
       /* Fall through.  */
 
     case by_name:
 sort_by_name:
-      ret = strcmp (bfd_get_section_name (asec->owner, asec),
-                   bfd_get_section_name (bsec->owner, bsec));
+      ret = strcmp (bfd_section_name (asec), bfd_section_name (bsec));
       break;
 
     case by_name_alignment:
-      ret = strcmp (bfd_get_section_name (asec->owner, asec),
-                   bfd_get_section_name (bsec->owner, bsec));
+      ret = strcmp (bfd_section_name (asec), bfd_section_name (bsec));
       if (ret)
        break;
       /* Fall through.  */
 
     case by_alignment:
-      ret = (bfd_section_alignment (bsec->owner, bsec)
-            - bfd_section_alignment (asec->owner, asec));
+      ret = bfd_section_alignment (bsec) - bfd_section_alignment (asec);
       break;
     }
 
@@ -610,7 +604,7 @@ walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
 
   for (s = file->the_bfd->sections; s != NULL; s = s->next)
     {
-      const char *sname = bfd_get_section_name (file->the_bfd, s);
+      const char *sname = bfd_section_name (s);
       bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
 
       if (!skip)
@@ -647,7 +641,7 @@ walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
        walk_wild_consider_section (ptr, file, s, sec0, callback, data);
       else
        {
-         const char *sname = bfd_get_section_name (file->the_bfd, s);
+         const char *sname = bfd_section_name (s);
          bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
 
          if (!skip)
@@ -682,7 +676,7 @@ walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
        walk_wild_consider_section (ptr, file, s, sec0, callback, data);
       else
        {
-         const char *sname = bfd_get_section_name (file->the_bfd, s);
+         const char *sname = bfd_section_name (s);
          bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
 
          if (!skip)
@@ -734,7 +728,7 @@ walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
          walk_wild_consider_section (ptr, file, s, sec1, callback, data);
        else
          {
-           const char *sname = bfd_get_section_name (file->the_bfd, s);
+           const char *sname = bfd_section_name (s);
            bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
                                                   sname);
 
@@ -5314,9 +5308,8 @@ lang_size_sections_1
                           " section %s\n"), os->name);
 
                input = os->children.head->input_section.section;
-               bfd_set_section_vma (os->bfd_section->owner,
-                                    os->bfd_section,
-                                    bfd_section_vma (input->owner, input));
+               bfd_set_section_vma (os->bfd_section,
+                                    bfd_section_vma (input));
                if (!(os->bfd_section->flags & SEC_FIXED_SIZE))
                  os->bfd_section->size = input->size;
                break;
@@ -5371,13 +5364,11 @@ lang_size_sections_1
                        if (command_line.check_section_addresses)
                          einfo (_("%F%P: error: no memory region specified"
                                   " for loadable section `%s'\n"),
-                                bfd_get_section_name (link_info.output_bfd,
-                                                      os->bfd_section));
+                                bfd_section_name (os->bfd_section));
                        else
                          einfo (_("%P: warning: no memory region specified"
                                   " for loadable section `%s'\n"),
-                                bfd_get_section_name (link_info.output_bfd,
-                                                      os->bfd_section));
+                                bfd_section_name (os->bfd_section));
                      }
 
                    newdot = os->region->current;
@@ -5406,7 +5397,7 @@ lang_size_sections_1
                             os->name, (unsigned long) dotdelta);
                  }
 
-               bfd_set_section_vma (0, os->bfd_section, newdot);
+               bfd_set_section_vma (os->bfd_section, newdot);
 
                os->bfd_section->output_offset = 0;
              }
@@ -6464,8 +6455,7 @@ lang_end (void)
       bfd_vma val;
 
       val = (h->u.def.value
-            + bfd_get_section_vma (link_info.output_bfd,
-                                   h->u.def.section->output_section)
+            + bfd_section_vma (h->u.def.section->output_section)
             + h->u.def.section->output_offset);
       if (!bfd_set_start_address (link_info.output_bfd, val))
        einfo (_("%F%P: %s: can't set start address\n"), entry_symbol.name);
@@ -6496,10 +6486,9 @@ lang_end (void)
                einfo (_("%P: warning: cannot find entry symbol %s;"
                         " defaulting to %V\n"),
                       entry_symbol.name,
-                      bfd_get_section_vma (link_info.output_bfd, ts));
-             if (!(bfd_set_start_address
-                   (link_info.output_bfd,
-                    bfd_get_section_vma (link_info.output_bfd, ts))))
+                      bfd_section_vma (ts));
+             if (!bfd_set_start_address (link_info.output_bfd,
+                                         bfd_section_vma (ts)))
                einfo (_("%F%P: can't set start address\n"));
            }
          else
index 577b911da8a6ffb5b845fee6c4789da1da169c47..3cfbc39e5bdc551b2021559bbaa4431634ca9f5f 100644 (file)
@@ -1014,33 +1014,31 @@ build_filler_bfd (int include_edata)
     {
       edata_s = bfd_make_section_old_way (filler_bfd, ".edata");
       if (edata_s == NULL
-         || !bfd_set_section_flags (filler_bfd, edata_s,
-                                    (SEC_HAS_CONTENTS
-                                     | SEC_ALLOC
-                                     | SEC_LOAD
-                                     | SEC_KEEP
-                                     | SEC_IN_MEMORY)))
+         || !bfd_set_section_flags (edata_s, (SEC_HAS_CONTENTS
+                                              | SEC_ALLOC
+                                              | SEC_LOAD
+                                              | SEC_KEEP
+                                              | SEC_IN_MEMORY)))
        {
          einfo (_("%X%P: can not create .edata section: %E\n"));
          return;
        }
-      bfd_set_section_size (filler_bfd, edata_s, edata_sz);
+      bfd_set_section_size (edata_s, edata_sz);
     }
 
   reloc_s = bfd_make_section_old_way (filler_bfd, ".reloc");
   if (reloc_s == NULL
-      || !bfd_set_section_flags (filler_bfd, reloc_s,
-                                (SEC_HAS_CONTENTS
-                                 | SEC_ALLOC
-                                 | SEC_LOAD
-                                 | SEC_KEEP
-                                 | SEC_IN_MEMORY)))
+      || !bfd_set_section_flags (reloc_s, (SEC_HAS_CONTENTS
+                                          | SEC_ALLOC
+                                          | SEC_LOAD
+                                          | SEC_KEEP
+                                          | SEC_IN_MEMORY)))
     {
       einfo (_("%X%P: can not create .reloc section: %E\n"));
       return;
     }
 
-  bfd_set_section_size (filler_bfd, reloc_s, 0);
+  bfd_set_section_size (reloc_s, 0);
 
   ldlang_add_file (filler_file);
 }
@@ -1303,7 +1301,7 @@ pe_walk_relocs (struct bfd_link_info *info,
        {
          arelent **relocs;
          int relsize, nrelocs, i;
-         int flags = bfd_get_section_flags (b, s);
+         int flags = bfd_section_flags (s);
 
          /* Skip discarded linkonce sections.  */
          if (flags & SEC_LINK_ONCE
@@ -1947,8 +1945,8 @@ quick_section (bfd *abfd, const char *name, int flags, int align)
   asymbol *sym;
 
   sec = bfd_make_section_old_way (abfd, name);
-  bfd_set_section_flags (abfd, sec, flags | SEC_ALLOC | SEC_LOAD | SEC_KEEP);
-  bfd_set_section_alignment (abfd, sec, align);
+  bfd_set_section_flags (sec, flags | SEC_ALLOC | SEC_LOAD | SEC_KEEP);
+  bfd_set_section_alignment (sec, align);
   /* Remember to undo this before trying to link internally!  */
   sec->output_section = sec;
 
@@ -2072,7 +2070,7 @@ make_head (bfd *parent)
      pointer to the list points to the *end* of this section, which is
      the start of the list of sections from other objects.  */
 
-  bfd_set_section_size (abfd, id2, 20);
+  bfd_set_section_size (id2, 20);
   d2 = xmalloc (20);
   id2->contents = d2;
   memset (d2, 0, 20);
@@ -2084,16 +2082,16 @@ make_head (bfd *parent)
   save_relocs (id2);
 
   if (pe_use_nul_prefixed_import_tables)
-    bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
+    bfd_set_section_size (id5, PE_IDATA5_SIZE);
   else
-    bfd_set_section_size (abfd, id5, 0);
+    bfd_set_section_size (id5, 0);
   d5 = xmalloc (PE_IDATA5_SIZE);
   id5->contents = d5;
   memset (d5, 0, PE_IDATA5_SIZE);
   if (pe_use_nul_prefixed_import_tables)
-    bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
+    bfd_set_section_size (id4, PE_IDATA4_SIZE);
   else
-    bfd_set_section_size (abfd, id4, 0);
+    bfd_set_section_size (id4, 0);
   d4 = xmalloc (PE_IDATA4_SIZE);
   id4->contents = d4;
   memset (d4, 0, PE_IDATA4_SIZE);
@@ -2154,12 +2152,12 @@ make_tail (bfd *parent)
   id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
   quick_symbol (abfd, U (""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
 
-  bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
+  bfd_set_section_size (id4, PE_IDATA4_SIZE);
   d4 = xmalloc (PE_IDATA4_SIZE);
   id4->contents = d4;
   memset (d4, 0, PE_IDATA4_SIZE);
 
-  bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
+  bfd_set_section_size (id5, PE_IDATA5_SIZE);
   d5 = xmalloc (PE_IDATA5_SIZE);
   id5->contents = d5;
   memset (d5, 0, PE_IDATA5_SIZE);
@@ -2167,7 +2165,7 @@ make_tail (bfd *parent)
   len = strlen (dll_filename) + 1;
   if (len & 1)
     len++;
-  bfd_set_section_size (abfd, id7, len);
+  bfd_set_section_size (id7, len);
   d7 = xmalloc (len);
   id7->contents = d7;
   strcpy ((char *) d7, dll_filename);
@@ -2339,7 +2337,7 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
 
   if (include_jmp_stub)
     {
-      bfd_set_section_size (abfd, tx, jmp_byte_count);
+      bfd_set_section_size (tx, jmp_byte_count);
       td = xmalloc (jmp_byte_count);
       tx->contents = td;
       memcpy (td, jmp_bytes, jmp_byte_count);
@@ -2374,16 +2372,16 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
       save_relocs (tx);
     }
   else
-    bfd_set_section_size (abfd, tx, 0);
+    bfd_set_section_size (tx, 0);
 
-  bfd_set_section_size (abfd, id7, 4);
+  bfd_set_section_size (id7, 4);
   d7 = xmalloc (4);
   id7->contents = d7;
   memset (d7, 0, 4);
   quick_reloc (abfd, 0, BFD_RELOC_RVA, 5);
   save_relocs (id7);
 
-  bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
+  bfd_set_section_size (id5, PE_IDATA5_SIZE);
   d5 = xmalloc (PE_IDATA5_SIZE);
   id5->contents = d5;
   memset (d5, 0, PE_IDATA5_SIZE);
@@ -2400,7 +2398,7 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
       save_relocs (id5);
     }
 
-  bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
+  bfd_set_section_size (id4, PE_IDATA4_SIZE);
   d4 = xmalloc (PE_IDATA4_SIZE);
   id4->contents = d4;
   memset (d4, 0, PE_IDATA4_SIZE);
@@ -2420,7 +2418,7 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
   if (exp->flag_noname)
     {
       len = 0;
-      bfd_set_section_size (abfd, id6, 0);
+      bfd_set_section_size (id6, 0);
     }
   else
     {
@@ -2433,7 +2431,7 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
        len = 2 + strlen (exp->name) + 1;
       if (len & 1)
        len++;
-      bfd_set_section_size (abfd, id6, len);
+      bfd_set_section_size (id6, len);
       d6 = xmalloc (len);
       id6->contents = d6;
       memset (d6, 0, len);
@@ -2491,7 +2489,7 @@ make_singleton_name_thunk (const char *import, bfd *parent)
   quick_symbol (abfd, "__nm_", import, "", UNDSEC, BSF_GLOBAL, 0);
 
   /* We need space for the real thunk and for the null terminator.  */
-  bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE * 2);
+  bfd_set_section_size (id4, PE_IDATA4_SIZE * 2);
   d4 = xmalloc (PE_IDATA4_SIZE * 2);
   id4->contents = d4;
   memset (d4, 0, PE_IDATA4_SIZE * 2);
@@ -2568,7 +2566,7 @@ make_import_fixup_entry (const char *name,
   quick_symbol (abfd, U (""), symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
   quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
 
-  bfd_set_section_size (abfd, id2, 20);
+  bfd_set_section_size (id2, 20);
   d2 = xmalloc (20);
   id2->contents = d2;
   memset (d2, 0, 20);
@@ -2643,7 +2641,7 @@ make_runtime_pseudo_reloc (const char *name ATTRIBUTE_UNUSED,
 
       quick_symbol (abfd, "__imp_", name, "", UNDSEC, BSF_GLOBAL, 0);
 
-      bfd_set_section_size (abfd, rt_rel, size);
+      bfd_set_section_size (rt_rel, size);
       rt_rel_d = xmalloc (size);
       rt_rel->contents = rt_rel_d;
       memset (rt_rel_d, 0, size);
@@ -2660,7 +2658,7 @@ make_runtime_pseudo_reloc (const char *name ATTRIBUTE_UNUSED,
     }
   else
     {
-      bfd_set_section_size (abfd, rt_rel, 8);
+      bfd_set_section_size (rt_rel, 8);
       rt_rel_d = xmalloc (8);
       rt_rel->contents = rt_rel_d;
       memset (rt_rel_d, 0, 8);
@@ -2708,7 +2706,7 @@ pe_create_runtime_relocator_reference (bfd *parent)
   quick_symbol (abfd, "", U ("_pei386_runtime_relocator"), "", UNDSEC,
                BSF_NO_FLAGS, 0);
 
-  bfd_set_section_size (abfd, extern_rt_rel, PE_IDATA5_SIZE);
+  bfd_set_section_size (extern_rt_rel, PE_IDATA5_SIZE);
   extern_rt_rel_d = xcalloc (1, PE_IDATA5_SIZE);
   extern_rt_rel->contents = extern_rt_rel_d;
 
@@ -3571,7 +3569,7 @@ pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info)
   generate_reloc (abfd, info);
   if (reloc_sz > 0)
     {
-      bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
+      bfd_set_section_size (reloc_s, reloc_sz);
 
       /* Resize the sections.  */
       lang_reset_memory_regions ();
@@ -3603,7 +3601,7 @@ pe_exe_fill_sections (bfd *abfd, struct bfd_link_info *info)
   generate_reloc (abfd, info);
   if (reloc_sz > 0)
     {
-      bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
+      bfd_set_section_size (reloc_s, reloc_sz);
 
       /* Resize the sections.  */
       lang_reset_memory_regions ();
index e56e2c0b866ac326ddb8af33d1252506a355622a..8a82ed0565f82f6176f6e818c74de0bc651ea678 100644 (file)
@@ -1,3 +1,7 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * ctf-open-bfd.c: Update throughout for bfd section macro changes.
+
 2019-09-09  Phil Blundell  <pb@pbcl.net>
 
        binutils 2.33 branch created.
index bb2d7e64de21b9c1aa8f69e75bf7159b5c8824d9..6a0c15531ef7cb6fea83c49a1595f433f7c88565 100644 (file)
@@ -100,7 +100,7 @@ ctf_bfdopen (struct bfd *abfd, int *errp)
 
   ctfsect.cts_name = _CTF_SECTION;
   ctfsect.cts_entsize = 1;
-  ctfsect.cts_size = bfd_section_size (abfd, ctf_asect);
+  ctfsect.cts_size = bfd_section_size (ctf_asect);
   ctfsect.cts_data = contents;
 
   if ((arc = ctf_bfdopen_ctfsect (abfd, &ctfsect, errp)) != NULL)
@@ -157,7 +157,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
            }
          strsect.cts_data = contents;
          strsect.cts_name = (char *) strsect.cts_data + strhdr->sh_name;
-         strsect.cts_size = bfd_section_size (abfd, str_asect);
+         strsect.cts_size = bfd_section_size (str_asect);
          strsect.cts_entsize = strhdr->sh_size;
          strsectp = &strsect;
 
@@ -170,7 +170,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
 
          symsect.cts_name = (char *) strsect.cts_data + symhdr->sh_name;
          symsect.cts_entsize = symhdr->sh_size;
-         symsect.cts_size = bfd_section_size (abfd, sym_asect);
+         symsect.cts_size = bfd_section_size (sym_asect);
          symsect.cts_data = contents;
          symsectp = &symsect;
        }
index d5b412275fc0b60c9457942817e4e4161a7907f8..0d8abcd7ff2017c7f2427a9bd3952417ac5aeeb3 100644 (file)
@@ -1,3 +1,7 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * arc-ext.c: Update throughout for bfd section macro changes.
+
 2019-09-18  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * Makefile.in: Re-generate.
index bf578871d768d57177386bdddc78a5cb16ab29e3..cfb13aa0e1d3a2b8e234f5bc1d1f28984784dd11 100644 (file)
@@ -438,7 +438,7 @@ build_ARC_extmap (bfd *text_bfd)
          sizeof (".gnu.linkonce.arcextmap.") - 1)
        || !strcmp (sect->name,".arcextmap"))
       {
-       bfd_size_type  count  = bfd_get_section_size (sect);
+       bfd_size_type  count  = bfd_section_size (sect);
        unsigned char* buffer = xmalloc (count);
 
        if (buffer)
index d16f2cfa57c78201a1f0a3c0620f0864223e5936..191e2370a98579a21b2f56d75577eaaa20a50c5a 100644 (file)
@@ -1,3 +1,11 @@
+2019-09-18  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2019-06-13  Stafford Horne  <shorne@gmail.com>
 
        * or1k/cpu.c: Regenerate.
index c198027824df3348b8c2083ffc041ff234b5be29..ff06497d5c6505a2962609f33b1d659b2f206ec8 100644 (file)
@@ -101,7 +101,7 @@ sim_load_file (SIM_DESC sd, const char *myname, host_callback *callback,
        {
          bfd_size_type size;
 
-         size = bfd_get_section_size (s);
+         size = bfd_section_size (s);
          if (size > 0)
            {
              unsigned char *buffer;
@@ -119,13 +119,13 @@ sim_load_file (SIM_DESC sd, const char *myname, host_callback *callback,
                  return NULL;
                }
              if (lma_p)
-               lma = bfd_section_lma (result_bfd, s);
+               lma = bfd_section_lma (s);
              else
-               lma = bfd_section_vma (result_bfd, s);
+               lma = bfd_section_vma (s);
              if (verbose_p)
                {
                  xprintf (callback, "Loading section %s, size 0x%lx %s ",
-                          bfd_get_section_name (result_bfd, s),
+                          bfd_section_name (s),
                           (unsigned long) size,
                           (lma_p ? "lma" : "vma"));
                  xprintf_bfd_vma (callback, lma);
index c94b2f77ac3b1a68f3aaba6f4b1fd5820925c58b..e83a2e4d0c83206b7f3a3d70fefd11c7c5191619 100644 (file)
@@ -263,11 +263,11 @@ sim_analyze_program (SIM_DESC sd, const char *prog_name, bfd *prog_bfd)
   STATE_START_ADDR (sd) = bfd_get_start_address (prog_bfd);
 
   for (s = prog_bfd->sections; s; s = s->next)
-    if (strcmp (bfd_get_section_name (prog_bfd, s), ".text") == 0)
+    if (strcmp (bfd_section_name (s), ".text") == 0)
       {
        STATE_TEXT_SECTION (sd) = s;
-       STATE_TEXT_START (sd) = bfd_get_section_vma (prog_bfd, s);
-       STATE_TEXT_END (sd) = STATE_TEXT_START (sd) + bfd_section_size (prog_bfd, s);
+       STATE_TEXT_START (sd) = bfd_section_vma (s);
+       STATE_TEXT_END (sd) = STATE_TEXT_START (sd) + bfd_section_size (s);
        break;
       }
 
index 1a5d421caffe9f9bf7d7425e5803384ea24dc120..ebfb0e586b4ac045d327c267d3f03ecbc6a57492 100644 (file)
@@ -315,17 +315,17 @@ cris_set_section_offset_iterator (bfd *abfd, asection *s, void *vp)
   SIM_DESC sd = p->sd;
   int offset = p->offset;
 
-  if ((bfd_get_section_flags (abfd, s) & SEC_ALLOC))
+  if ((bfd_section_flags (s) & SEC_ALLOC))
     {
-      bfd_vma vma = bfd_get_section_vma (abfd, s);
+      bfd_vma vma = bfd_section_vma (s);
       
-      bfd_set_section_vma (abfd, s, vma + offset);
+      bfd_set_section_vma (s, vma + offset);
     }
 
   /* This seems clumsy and inaccurate, but let's stick to doing it the
      same way as sim_analyze_program for consistency.  */
-  if (strcmp (bfd_get_section_name (abfd, s), ".text") == 0)
-    STATE_TEXT_START (sd) = bfd_get_section_vma (abfd, s);
+  if (strcmp (bfd_section_name (s), ".text") == 0)
+    STATE_TEXT_START (sd) = bfd_section_vma (s);
 }
 
 /* Adjust the start-address, LMA and VMA of a SD.  Must be called
@@ -360,10 +360,10 @@ get_progbounds_iterator (bfd *abfd ATTRIBUTE_UNUSED, asection *s, void *vp)
 {
   struct progbounds *pbp = (struct progbounds *) vp;
 
-  if ((bfd_get_section_flags (abfd, s) & SEC_ALLOC))
+  if ((bfd_section_flags (s) & SEC_ALLOC))
     {
-      bfd_size_type sec_size = bfd_get_section_size (s);
-      bfd_size_type sec_start = bfd_get_section_vma (abfd, s);
+      bfd_size_type sec_size = bfd_section_size (s);
+      bfd_size_type sec_start = bfd_section_vma (s);
       bfd_size_type sec_end = sec_start + sec_size;
 
       if (sec_end > pbp->endmem)
@@ -372,7 +372,7 @@ get_progbounds_iterator (bfd *abfd ATTRIBUTE_UNUSED, asection *s, void *vp)
       if (sec_start < pbp->startmem)
        pbp->startmem = sec_start;
 
-      if ((bfd_get_section_flags (abfd, s) & SEC_LOAD))
+      if ((bfd_section_flags (s) & SEC_LOAD))
        {
          if (sec_end > pbp->end_loadmem)
            pbp->end_loadmem = sec_end;
index d6a51b15910411ef6ea7a0588ee3b0369b34c126..a0c85a091394b040d4245dac4a3a86cfb706b1ab 100644 (file)
@@ -1051,14 +1051,14 @@ bfd_load (const char *fname)
     if (sis_verbose)
        printf("loading %s:", fname);
     for (section = pbfd->sections; section; section = section->next) {
-       if (bfd_get_section_flags(pbfd, section) & SEC_ALLOC) {
+       if (bfd_section_flags (section) & SEC_ALLOC) {
            bfd_vma         section_address;
            unsigned long   section_size;
            const char     *section_name;
 
-           section_name = bfd_get_section_name(pbfd, section);
+           section_name = bfd_section_name (section);
 
-           section_address = bfd_get_section_vma(pbfd, section);
+           section_address = bfd_section_vma (section);
            /*
             * Adjust sections from a.out files, since they don't carry their
             * addresses with.
@@ -1084,14 +1084,14 @@ bfd_load (const char *fname)
                }
            }
 
-           section_size = bfd_section_size(pbfd, section);
+           section_size = bfd_section_size (section);
 
            if (sis_verbose)
                printf("\nsection %s at 0x%08lx (0x%lx bytes)",
                       section_name, section_address, section_size);
 
            /* Text, data or lit */
-           if (bfd_get_section_flags(pbfd, section) & SEC_LOAD) {
+           if (bfd_section_flags (section) & SEC_LOAD) {
                file_ptr        fptr;
 
                fptr = 0;
index 2698b2e28e772e0ef829b8cdd0f20cdd34cc0837..71312d36442bc341295279d4302af63886b14bcb 100644 (file)
@@ -50,21 +50,18 @@ find_base (bfd *prog_bfd)
   found = 0;
   for (s = prog_bfd->sections; s; s = s->next)
     {
-      if ((strcmp (bfd_get_section_name (prog_bfd, s), ".boot") == 0)
-         || (strcmp (bfd_get_section_name (prog_bfd, s), ".text") == 0)
-         || (strcmp (bfd_get_section_name (prog_bfd, s), ".data") == 0)
-         || (strcmp (bfd_get_section_name (prog_bfd, s), ".bss") == 0))
+      if ((strcmp (bfd_section_name (s), ".boot") == 0)
+         || (strcmp (bfd_section_name (s), ".text") == 0)
+         || (strcmp (bfd_section_name (s), ".data") == 0)
+         || (strcmp (bfd_section_name (s), ".bss") == 0))
        {
          if (!found)
            {
-             base = bfd_get_section_vma (prog_bfd, s);
+             base = bfd_section_vma (s);
              found = 1;
            }
          else
-           base =
-             bfd_get_section_vma (prog_bfd,
-                                  s) < base ? bfd_get_section_vma (prog_bfd,
-                                                                   s) : base;
+           base = bfd_section_vma (s) < base ? bfd_section_vma (s) : base;
        }
     }
   return base & ~(0xffffUL);
index 3937fea0883747c76515ae02e590ac2b6b056f44..c6a3b2dcaa9a9271757f0a236cf2cb9493d78164 100644 (file)
@@ -74,11 +74,11 @@ m32c_load (bfd * prog)
          remains as a reminder.  */
       if ((s->flags & SEC_ALLOC) && !(s->flags & SEC_READONLY))
        {
-         if (strcmp (bfd_get_section_name (prog, s), ".stack"))
+         if (strcmp (bfd_section_name (s), ".stack"))
            {
              int secend =
-               bfd_get_section_size (s) + bfd_section_lma (prog, s);
-             if (heaptop < secend && bfd_section_lma (prog, s) < 0x10000)
+               bfd_section_size (s) + bfd_section_lma (s);
+             if (heaptop < secend && bfd_section_lma (s) < 0x10000)
                {
                  heaptop = heapbottom = secend;
                }
@@ -91,14 +91,14 @@ m32c_load (bfd * prog)
          bfd_size_type size;
          bfd_vma base;
 
-         size = bfd_get_section_size (s);
+         size = bfd_section_size (s);
          if (size <= 0)
            continue;
 
-         base = bfd_section_lma (prog, s);
+         base = bfd_section_lma (s);
          if (verbose)
            fprintf (stderr, "[load a=%08x s=%08x %s]\n",
-                    (int) base, (int) size, bfd_get_section_name (prog, s));
+                    (int) base, (int) size, bfd_section_name (s));
          buf = (char *) malloc (size);
          bfd_get_section_contents (prog, s, buf, 0, size);
          mem_put_blk (base, buf, size);
index e507c978b831cbda66642e26a56e2d0e93561cf1..bc75d15e3c9b59799b88314165c093bcc69e5e7c 100644 (file)
@@ -231,7 +231,7 @@ sim_disasm_one (void)
          if (s->flags & SEC_CODE || code_section == 0)
            {
              code_section = s;
-             code_base = bfd_section_lma (current_bfd, s);
+             code_base = bfd_section_lma (s);
              break;
            }
        }
index 9e8ccab18078c69c20d757e6824fc017cee7198b..a5131d2a977ccaf211b9b74b355dd273209e773e 100644 (file)
@@ -344,15 +344,15 @@ sim_prepare_for_program (SIM_DESC sd, bfd* abfd)
             {
               bfd_size_type size;
 
-              size = bfd_get_section_size (s);
+             size = bfd_section_size (s);
               if (size > 0)
                 {
                   bfd_vma lma;
 
                   if (STATE_LOAD_AT_LMA_P (sd))
-                    lma = bfd_section_lma (abfd, s);
+                   lma = bfd_section_lma (s);
                   else
-                    lma = bfd_section_vma (abfd, s);
+                   lma = bfd_section_vma (s);
 
                   if (lma <= 0xFFFE && lma+size >= 0x10000)
                     cpu->cpu_use_elf_start = 0;
index cf275ff7025616185401cf89451a5967f280b3b6..e7b6371e1dd4ab868ba3c9254d121498e5175f64 100644 (file)
@@ -391,16 +391,16 @@ htab_sum_binary(bfd *abfd,
                PTR data)
 {
   htab_binary_sizes *sizes = (htab_binary_sizes*)data;
-  unsigned_word size = bfd_get_section_size (sec);
-  unsigned_word vma = bfd_get_section_vma (abfd, sec);
-  unsigned_word ra = bfd_get_section_lma (abfd, sec);
+  unsigned_word size = bfd_section_size (sec);
+  unsigned_word vma = bfd_section_vma (sec);
+  unsigned_word ra = bfd_section_lma (sec);
 
   /* skip the section if no memory to allocate */
-  if (! (bfd_get_section_flags(abfd, sec) & SEC_ALLOC))
+  if (! (bfd_section_flags (sec) & SEC_ALLOC))
     return;
 
-  if ((bfd_get_section_flags (abfd, sec) & SEC_CODE)
-      || (bfd_get_section_flags (abfd, sec) & SEC_READONLY)) {
+  if ((bfd_section_flags (sec) & SEC_CODE)
+      || (bfd_section_flags (sec) & SEC_READONLY)) {
     if (sizes->text_bound < vma + size)
       sizes->text_bound = ALIGN_PAGE(vma + size);
     if (sizes->text_base > vma)
@@ -408,8 +408,8 @@ htab_sum_binary(bfd *abfd,
     if (sizes->text_ra > ra)
       sizes->text_ra = FLOOR_PAGE(ra);
   }
-  else if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
-          || (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)) {
+  else if ((bfd_section_flags (sec) & SEC_DATA)
+          || (bfd_section_flags (sec) & SEC_ALLOC)) {
     if (sizes->data_bound < vma + size)
       sizes->data_bound = ALIGN_PAGE(vma + size);
     if (sizes->data_base > vma)
@@ -432,41 +432,41 @@ htab_dma_binary(bfd *abfd,
   device *me = sizes->me;
 
   /* skip the section if no memory to allocate */
-  if (! (bfd_get_section_flags(abfd, sec) & SEC_ALLOC))
+  if (! (bfd_section_flags (sec) & SEC_ALLOC))
     return;
 
   /* check/ignore any sections of size zero */
-  section_size = bfd_get_section_size (sec);
+  section_size = bfd_section_size (sec);
   if (section_size == 0)
     return;
 
   /* if nothing to load, ignore this one */
-  if (! (bfd_get_section_flags(abfd, sec) & SEC_LOAD))
+  if (! (bfd_section_flags (sec) & SEC_LOAD))
     return;
 
   /* find where it is to go */
-  section_vma = bfd_get_section_vma(abfd, sec);
+  section_vma = bfd_section_vma (sec);
   section_ra = 0;
-  if ((bfd_get_section_flags (abfd, sec) & SEC_CODE)
-      || (bfd_get_section_flags (abfd, sec) & SEC_READONLY))
+  if ((bfd_section_flags (sec) & SEC_CODE)
+      || (bfd_section_flags (sec) & SEC_READONLY))
     section_ra = (section_vma - sizes->text_base + sizes->text_ra);
-  else if ((bfd_get_section_flags (abfd, sec) & SEC_DATA))
+  else if ((bfd_section_flags (sec) & SEC_DATA))
     section_ra = (section_vma - sizes->data_base + sizes->data_ra);
   else 
     return; /* just ignore it */
 
   DTRACE(htab,
         ("load - name=%-7s vma=0x%.8lx size=%6ld ra=0x%.8lx flags=%3lx(%s%s%s%s%s )\n",
-         bfd_get_section_name(abfd, sec),
+         bfd_section_name (sec),
          (long)section_vma,
          (long)section_size,
          (long)section_ra,
-         (long)bfd_get_section_flags(abfd, sec),
-         bfd_get_section_flags(abfd, sec) & SEC_LOAD ? " LOAD" : "",
-         bfd_get_section_flags(abfd, sec) & SEC_CODE ? " CODE" : "",
-         bfd_get_section_flags(abfd, sec) & SEC_DATA ? " DATA" : "",
-         bfd_get_section_flags(abfd, sec) & SEC_ALLOC ? " ALLOC" : "",
-         bfd_get_section_flags(abfd, sec) & SEC_READONLY ? " READONLY" : ""
+         (long)bfd_section_flags (sec),
+         bfd_section_flags (sec) & SEC_LOAD ? " LOAD" : "",
+         bfd_section_flags (sec) & SEC_CODE ? " CODE" : "",
+         bfd_section_flags (sec) & SEC_DATA ? " DATA" : "",
+         bfd_section_flags (sec) & SEC_ALLOC ? " ALLOC" : "",
+         bfd_section_flags (sec) & SEC_READONLY ? " READONLY" : ""
          ));
 
   /* dma in the sections data */
index 0e7403bb6c563bccf319af113bac259a43b48f06..779c95c5a24ce3a3112c2b67c348fef718a304c0 100644 (file)
@@ -324,39 +324,39 @@ update_for_binary_section(bfd *abfd,
   device *me = (device*)obj;
 
   /* skip the section if no memory to allocate */
-  if (! (bfd_get_section_flags(abfd, the_section) & SEC_ALLOC))
+  if (! (bfd_section_flags (the_section) & SEC_ALLOC))
     return;
 
   /* check/ignore any sections of size zero */
-  section_size = bfd_get_section_size (the_section);
+  section_size = bfd_section_size (the_section);
   if (section_size == 0)
     return;
 
   /* find where it is to go */
-  section_vma = bfd_get_section_vma(abfd, the_section);
+  section_vma = bfd_section_vma (the_section);
 
   DTRACE(binary,
         ("name=%-7s, vma=0x%.8lx, size=%6ld, flags=%3lx(%s%s%s%s%s )\n",
-         bfd_get_section_name(abfd, the_section),
+         bfd_section_name (the_section),
          (long)section_vma,
          (long)section_size,
-         (long)bfd_get_section_flags(abfd, the_section),
-         bfd_get_section_flags(abfd, the_section) & SEC_LOAD ? " LOAD" : "",
-         bfd_get_section_flags(abfd, the_section) & SEC_CODE ? " CODE" : "",
-         bfd_get_section_flags(abfd, the_section) & SEC_DATA ? " DATA" : "",
-         bfd_get_section_flags(abfd, the_section) & SEC_ALLOC ? " ALLOC" : "",
-         bfd_get_section_flags(abfd, the_section) & SEC_READONLY ? " READONLY" : ""
+         (long)bfd_section_flags (the_section),
+         bfd_section_flags (the_section) & SEC_LOAD ? " LOAD" : "",
+         bfd_section_flags (the_section) & SEC_CODE ? " CODE" : "",
+         bfd_section_flags (the_section) & SEC_DATA ? " DATA" : "",
+         bfd_section_flags (the_section) & SEC_ALLOC ? " ALLOC" : "",
+         bfd_section_flags (the_section) & SEC_READONLY ? " READONLY" : ""
          ));
 
   /* If there is an .interp section, it means it needs a shared library interpreter.  */
-  if (strcmp(".interp", bfd_get_section_name(abfd, the_section)) == 0)
+  if (strcmp(".interp", bfd_section_name (the_section)) == 0)
     error("Shared libraries are not yet supported.\n");
 
   /* determine the devices access */
   access = access_read;
-  if (bfd_get_section_flags(abfd, the_section) & SEC_CODE)
+  if (bfd_section_flags (the_section) & SEC_CODE)
     access |= access_exec;
-  if (!(bfd_get_section_flags(abfd, the_section) & SEC_READONLY))
+  if (!(bfd_section_flags (the_section) & SEC_READONLY))
     access |= access_write;
 
   /* if claim specified, allocate region from the memory device */
@@ -386,7 +386,7 @@ update_for_binary_section(bfd *abfd,
                          me);
 
   /* if a load dma in the required data */
-  if (bfd_get_section_flags(abfd, the_section) & SEC_LOAD) {
+  if (bfd_section_flags (the_section) & SEC_LOAD) {
     void *section_init = zalloc(section_size);
     if (!bfd_get_section_contents(abfd,
                                  the_section,
index c8c8ab89517ca1ef496d7b634c06de7f1c3f98a2..34ae923bcb71f87ad5fc44b5c9235fda1902c962 100644 (file)
@@ -56,7 +56,7 @@ find_section_name_by_offset (bfd *abfd, file_ptr filepos)
 
   for (s = abfd->sections; s; s = s->next)
     if (s->filepos == filepos)
-      return bfd_get_section_name (abfd, s);
+      return bfd_section_name (s);
 
   return "(unknown)";
 }
index fd999a15134d9177f6fb536d2b8595f163e87ad5..1a97527377b758b120b5856aeddb1a4156739f53 100644 (file)
@@ -224,7 +224,7 @@ sim_get_current_source_location (const char **  pfilename,
          if (s->flags & SEC_CODE || code_section == 0)
            {
              code_section = s;
-             code_base = bfd_section_lma (current_bfd, s);
+             code_base = bfd_section_lma (s);
              break;
            }
        }
index ef88146a5e92f63ccaff5db0a06e49e9cb251a16..68e4b96ed634b406e614513f4a3b7caa18970120 100644 (file)
@@ -164,14 +164,14 @@ build_swap_list (struct bfd *abfd)
          struct swap_list *sl;
          bfd_size_type size;
 
-         size = bfd_get_section_size (s);
+         size = bfd_section_size (s);
          if (size <= 0)
            continue;
          
          sl = malloc (sizeof (struct swap_list));
          assert (sl != NULL);
          sl->next = swap_list;
-         sl->start = bfd_section_lma (abfd, s);
+         sl->start = bfd_section_lma (s);
          sl->end = sl->start + size;
          swap_list = sl;
        }
index 65451ca8216a57055430d519e6535301581ef43e..a9b596bbc58993bb26a07654dcc170b6c49a4e52 100644 (file)
@@ -52,7 +52,7 @@ find_section_name_by_offset (bfd *abfd, file_ptr filepos)
 
   for (s = abfd->sections; s; s = s->next)
     if (s->filepos == filepos)
-      return bfd_get_section_name (abfd, s);
+      return bfd_section_name (s);
 
   return "(unknown)";
 }
index ed65d19a8f947e84c4ebb853fcfd5221decd50cb..a4ea680bff83fb8e6635c284797d62470e68d971 100644 (file)
@@ -228,7 +228,7 @@ sim_get_current_source_location (const char **  pfilename,
          if (s->flags & SEC_CODE || code_section == 0)
            {
              code_section = s;
-             code_base = bfd_section_lma (current_bfd, s);
+             code_base = bfd_section_lma (s);
              break;
            }
        }
This page took 0.381467 seconds and 4 git commands to generate.