binutils-gdb/bfd
Alan Modra 35c5dcc666 PR29355, ld segfaults with -r/-q and custom-named section .rela*
The bug testcase uses an output section named .rel or .rela which has
input .data sections mapped to it.  The input .data section has
relocations.  When counting output relocations SHT_REL and SHT_RELA
section reloc_count is ignored, with the justification that reloc
sections themselves can't have relocations and some backends use
reloc_count in reloc sections.  However, the test wrongly used the
output section type (which normally would match input section type).
Fix that.  Note that it is arguably wrong for ld to leave the output
.rel/.rela section type as SHT_REL/SHT_RELA when non-empty non-reloc
sections are written to it, but I'm not going to change that since it
might be useful to hand-craft relocs in a data section that is then
written to a SHT_REL/SHT_RELA output section.

	PR 29355
	* elflink.c (bfd_elf_final_link): Use input section type rather
	than output section type to determine whether to exclude using
	reloc_count from that section.
2022-07-12 12:05:28 +09:30
..
doc Re: use libiberty xmalloc in bfd/doc/chew.c 2022-06-01 10:52:05 +09:30
hosts
po Update version to 2.39.50 and regenerate files 2022-07-08 11:19:44 +01:00
.gitignore
acinclude.m4
aclocal.m4
aix5ppc-core.c
aix386-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
aout32.c
aout64.c
aout-cris.c
aout-ns32k.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
aout-target.h
aoutx.h Don't encode reloc.size 2022-06-08 21:33:00 +09:30
arc-got.h
arc-plt.def
arc-plt.h
archive64.c
archive.c
archures.c drop XC16x bits 2022-06-27 11:11:46 +02:00
bfd-in2.h drop XC16x bits 2022-06-27 11:11:46 +02:00
bfd-in.h Replace bfd_hostptr_t with uintptr_t 2022-05-27 22:08:59 +09:30
bfd.c
bfd.m4
bfdio.c bfd: handle codepage when opening files on MinGW 2022-06-28 16:55:24 +02:00
bfdwin.c
binary.c
cache.c
cf-i386lynx.c
ChangeLog Add markers for 2.39 branch 2022-07-08 10:41:07 +01:00
ChangeLog-0001
ChangeLog-0203
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-9193
ChangeLog-9495
ChangeLog-9697
ChangeLog-9899
cisco-core.c
coff64-rs6000.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
coff-aarch64.c
coff-alpha.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
coff-arm.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
coff-arm.h
coff-bfd.c Replace bfd_hostptr_t with uintptr_t 2022-05-27 22:08:59 +09:30
coff-bfd.h
coff-go32.c
coff-i386.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
coff-ia64.c
coff-mcore.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
coff-mips.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
coff-rs6000.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
coff-sh.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
coff-stgo32.c
coff-tic4x.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
coff-tic30.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
coff-tic54x.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
coff-x86_64.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
coff-z8k.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
coff-z80.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
coffcode.h asan: null deref in coff_write_relocs 2022-06-02 16:31:42 +09:30
coffgen.c asan: null dereference in coff_count_linenumbers 2022-06-04 20:57:36 +09:30
cofflink.c COFF: use hash for string table also when copying / stripping 2022-05-19 12:45:55 +02:00
coffswap.h
compress.c
config.bfd bfd: prune config.bfd's setting of targ_archs 2022-06-27 11:12:57 +02:00
config.in
configure Update version to 2.39.50 and regenerate files 2022-07-08 11:19:44 +01:00
configure.ac drop XC16x bits 2022-06-27 11:11:46 +02:00
configure.com Replace bfd_hostptr_t with uintptr_t 2022-05-27 22:08:59 +09:30
configure.host
COPYING
corefile.c
cpu-aarch64.c
cpu-aarch64.h
cpu-alpha.c
cpu-amdgcn.c
cpu-arc.c
cpu-arm.c
cpu-arm.h
cpu-avr.c
cpu-bfin.c
cpu-bpf.c
cpu-cr16.c
cpu-cris.c
cpu-crx.c
cpu-csky.c
cpu-d10v.c
cpu-d30v.c
cpu-dlx.c
cpu-epiphany.c
cpu-fr30.c
cpu-frv.c
cpu-ft32.c
cpu-h8300.c
cpu-h8300.h
cpu-hppa.c
cpu-i386.c
cpu-ia64-opc.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
cpu-ia64.c
cpu-iamcu.c
cpu-ip2k.c
cpu-iq2000.c
cpu-lm32.c
cpu-loongarch.c
cpu-m9s12x.c
cpu-m9s12xg.c
cpu-m32c.c
cpu-m32r.c
cpu-m68hc11.c
cpu-m68hc12.c
cpu-m68k.c
cpu-m68k.h
cpu-m10200.c
cpu-m10300.c
cpu-mcore.c
cpu-mep.c
cpu-metag.c
cpu-microblaze.c
cpu-mips.c
cpu-mmix.c
cpu-moxie.c
cpu-msp430.c
cpu-mt.c
cpu-nds32.c
cpu-nfp.c
cpu-nios2.c
cpu-ns32k.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
cpu-or1k.c
cpu-pdp11.c
cpu-pj.c
cpu-powerpc.c
cpu-pru.c
cpu-riscv.c
cpu-riscv.h
cpu-rl78.c
cpu-rs6000.c
cpu-rx.c
cpu-s12z.c
cpu-s390.c
cpu-score.c
cpu-sh.c
cpu-sparc.c
cpu-spu.c
cpu-tic4x.c
cpu-tic6x.c
cpu-tic30.c
cpu-tic54x.c
cpu-tilegx.c
cpu-tilepro.c
cpu-v850_rh850.c
cpu-v850.c
cpu-vax.c
cpu-visium.c
cpu-wasm32.c
cpu-xgate.c
cpu-xstormy16.c
cpu-xtensa.c
cpu-z8k.c
cpu-z80.c
dep-in.sed
development.sh
dwarf1.c
dwarf2.c PR29230, segv in lookup_symbol_in_variable_table 2022-06-15 10:24:33 +09:30
ecoff-bfd.h
ecoff.c asan: uninit write _bfd_ecoff_write_object_contents 2022-06-02 16:43:48 +09:30
ecofflink.c
ecoffswap.h
elf32-am33lin.c
elf32-arc.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-arm.c arm: Define elf_backend_extern_protected_data to 0 [PR 18705] 2022-06-25 10:27:49 -07:00
elf32-arm.h
elf32-avr.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-avr.h
elf32-bfin.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-bfin.h
elf32-cr16.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-cr16.h
elf32-cris.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-crx.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-csky.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-csky.h
elf32-d10v.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-d30v.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-dlx.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-dlx.h
elf32-epiphany.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-fr30.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-frv.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-ft32.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-gen.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-h8300.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-hppa.c
elf32-hppa.h
elf32-i386.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-ip2k.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-iq2000.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-lm32.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-m32c.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-m32r.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-m68hc1x.c
elf32-m68hc1x.h
elf32-m68hc11.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-m68hc12.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-m68k.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-m68k.h
elf32-mcore.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-mep.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-metag.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-metag.h
elf32-microblaze.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-mips.c BFD_RELOC_MIPS_16 2022-06-14 10:03:55 +09:30
elf32-moxie.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-msp430.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-mt.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-nds32.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
elf32-nds32.h
elf32-nios2.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-nios2.h
elf32-or1k.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-pj.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-ppc.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-ppc.h
elf32-pru.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-rl78.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-rx.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-rx.h
elf32-s12z.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-s390.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-score7.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-score.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-score.h
elf32-sh-relocs.h HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-sh.c
elf32-sparc.c
elf32-spu.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-spu.h
elf32-tic6x.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-tic6x.h
elf32-tilegx.c
elf32-tilegx.h
elf32-tilepro.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-tilepro.h
elf32-v850.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-v850.h
elf32-vax.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-visium.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-wasm32.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-xgate.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-xstormy16.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32-xtensa.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf32-z80.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf32.c
elf64-alpha.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf64-amdgcn.c
elf64-bpf.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf64-gen.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf64-hppa.c
elf64-hppa.h
elf64-ia64-vms.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
elf64-mips.c BFD_RELOC_MIPS_16 2022-06-14 10:03:55 +09:30
elf64-mmix.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf64-nfp.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf64-ppc.c PowerPC64: align plt_branch stubs 2022-06-28 13:02:26 +09:30
elf64-ppc.h
elf64-s390.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf64-sparc.c
elf64-tilegx.c
elf64-tilegx.h
elf64-x86-64.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf64.c
elf-attrs.c
elf-bfd.h ld: add --package-metadata 2022-05-26 12:56:12 +09:30
elf-eh-frame.c
elf-hppa.h Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf-ifunc.c
elf-linker-x86.h
elf-linux-core.h
elf-m10200.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elf-m10300.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elf-nacl.c
elf-nacl.h
elf-properties.c
elf-s390-common.c
elf-s390.h
elf-strtab.c
elf-vxworks.c
elf-vxworks.h
elf.c elf: Copy p_align of PT_GNU_STACK for stack alignment 2022-07-06 12:39:06 -07:00
elfcode.h
elfcore.h Revert "Revert "Fix fbsd core matching"" 2022-06-16 10:20:49 +09:30
elflink.c PR29355, ld segfaults with -r/-q and custom-named section .rela* 2022-07-12 12:05:28 +09:30
elfn32-mips.c BFD_RELOC_MIPS_16 2022-06-14 10:03:55 +09:30
elfnn-aarch64.c PR29293, elfnn-aarch64.c: def_protected member unintialized 2022-06-28 11:14:58 +09:30
elfnn-ia64.c
elfnn-loongarch.c Re: Fix new linker testsuite failures due to rwx segment test problems 2022-05-07 15:15:20 +09:30
elfnn-riscv.c
elfxx-aarch64.c
elfxx-aarch64.h
elfxx-ia64.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elfxx-ia64.h
elfxx-loongarch.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elfxx-loongarch.h
elfxx-mips.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
elfxx-mips.h
elfxx-riscv.c RISC-V: Added Zfhmin and Zhinxmin. 2022-07-07 16:23:54 +08:00
elfxx-riscv.h
elfxx-sparc.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elfxx-sparc.h
elfxx-target.h
elfxx-tilegx.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
elfxx-tilegx.h
elfxx-x86.c
elfxx-x86.h
format.c
gen-aout.c
genlink.h
go32stub.h
hash.c
host-aout.c
hppabsd-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
hpux-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
i386aout.c
i386bsd.c
i386lynx.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
i386msdos.c
ihex.c
init.c
irix-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
libaout.h
libbfd-in.h
libbfd.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
libbfd.h drop XC16x bits 2022-06-27 11:11:46 +02:00
libcoff-in.h COFF: use hash for string table also when copying / stripping 2022-05-19 12:45:55 +02:00
libcoff.h COFF: use hash for string table also when copying / stripping 2022-05-19 12:45:55 +02:00
libecoff.h
libhppa.h
libpei.h
libxcoff.h xcoff: implement linker relaxation 2022-04-20 15:11:47 +01:00
linker.c bfd: Check NULL pointer before setting ref_real 2022-05-04 17:57:58 -07:00
lynx-core.c
mach-o-aarch64.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
mach-o-arm.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
mach-o-i386.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
mach-o-target.c
mach-o-x86-64.c HOWTO size encoding 2022-06-08 21:33:00 +09:30
mach-o.c asan: uninitialised write in bfd_mach_o_write_contents 2022-06-04 20:57:36 +09:30
mach-o.h Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
MAINTAINERS
Makefile.am drop XC16x bits 2022-06-27 11:11:46 +02:00
Makefile.in drop XC16x bits 2022-06-27 11:11:46 +02:00
makefile.vms
mep-relocs.pl
merge.c
mmo.c
netbsd-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
netbsd.h
ns32k.h
ns32knetbsd.c
opncls.c
osf-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
pc532-mach.c
pdp11.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
pe-arm-wince.c
pe-arm.c
pe-i386.c
pe-mcore.c
pe-sh.c
pe-x86_64.c
pef-traceback.h
pef.c
pef.h
pei-aarch64.c
pei-arm-wince.c
pei-arm.c
pei-i386.c
pei-ia64.c
pei-mcore.c
pei-sh.c
pei-x86_64.c
peicode.h Replace bfd_hostptr_t with uintptr_t 2022-05-27 22:08:59 +09:30
peXXigen.c COFF/PE: keep linker version during objcopy / strip 2022-05-19 12:44:56 +02:00
plugin.c bfd: remove use of PTR 2022-05-10 11:21:37 +09:30
plugin.h
PORTING
ppcboot.c
ptrace-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
README
reloc16.c
reloc.c drop XC16x bits 2022-06-27 11:11:46 +02:00
rs6000-core.c
sco5-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
section.c
simple.c
som.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
som.h
srec.c
stab-syms.c
stabs.c
syms.c Don't encode reloc.size 2022-06-08 21:33:00 +09:30
sysdep.h
targets.c drop XC16x bits 2022-06-27 11:11:46 +02:00
targmatch.sed
tekhex.c
TODO
trad-core.c Remove use of bfd_uint64_t and similar 2022-05-27 22:08:59 +09:30
vax1knetbsd.c
vaxnetbsd.c
verilog.c
version.h Automatic date update in version.in 2022-07-12 00:00:22 +00:00
version.m4 Update version to 2.39.50 and regenerate files 2022-07-08 11:19:44 +01:00
vms-alpha.c Revert reloc howto nits 2022-06-08 21:33:00 +09:30
vms-lib.c
vms-misc.c
vms.h
warning.m4
wasm-module.c
wasm-module.h
xcofflink.c Re: xcoff: implement linker relaxation 2022-04-20 23:56:59 +09:30
xcofflink.h xcoff: implement linker relaxation 2022-04-20 15:11:47 +01:00
xsym.c
xsym.h
xtensa-isa.c
xtensa-modules.c

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

BFD is an object file library.  It permits applications to use the
same routines to process object files regardless of their format.

BFD is used by the GNU debugger, assembler, linker, and the binary
utilities.

The documentation on using BFD is scanty and may be occasionally
incorrect.  Pointers to documentation problems, or an entirely
rewritten manual, would be appreciated.

There is some BFD internals documentation in doc/bfdint.texi which may
help programmers who want to modify BFD.

BFD is normally built as part of another package.  See the build
instructions for that package, probably in a README file in the
appropriate directory.

BFD supports the following configure options:

  --target=TARGET
	The default target for which to build the library.  TARGET is
	a configuration target triplet, such as sparc-sun-solaris.
  --enable-targets=TARGET,TARGET,TARGET...
	Additional targets the library should support.  To include
	support for all known targets, use --enable-targets=all.
  --enable-64-bit-bfd
	Include support for 64 bit targets.  This is automatically
	turned on if you explicitly request a 64 bit target, but not
	for --enable-targets=all.  This requires a compiler with a 64
	bit integer type, such as gcc.
  --enable-shared
	Build BFD as a shared library.
  --with-mmap
	Use mmap when accessing files.  This is faster on some hosts,
	but slower on others.  It may not work on all hosts.

Report bugs in BFD to https://sourceware.org/bugzilla/

Patches are encouraged.  When sending patches, always send the output
of diff -u or diff -c from the original file to the new file.  Do not
send default diff output.  Do not make the diff from the new file to
the original file.  Remember that any patch must not break other
systems.  Remember that BFD must support cross compilation from any
host to any target, so patches which use ``#ifdef HOST'' are not
acceptable.  Please also read the ``Reporting Bugs'' section of the
gcc manual.

Bug reports without patches will be remembered, but they may never get
fixed until somebody volunteers to fix them.

Copyright (C) 2012-2022 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.