binutils-gdb/ld/emulparams
H.J. Lu 6f365fda85 elf: Add GNU_PROPERTY_1_NEEDED check
If GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS is set on any input
relocatable files:

1. Don't generate copy relocations.
2. Turn off extern_protected_data since it implies
GNU_PROPERTY_NO_COPY_ON_PROTECTED.
3. Treate reference to protected symbols with indirect external access
as local.
4. Set GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS on output.
5. When generating executable, clear this bit when there are non-GOT or
non-PLT relocations in input relocatable files without the bit set.
6. Add -z [no]indirect-extern-access to control indirect external access.

bfd/

	* elf-bfd (elf_obj_tdata): Add has_indirect_extern_access.
	(elf_has_indirect_extern_access): New.
	* elf-properties.c (_bfd_elf_parse_gnu_properties): Set
	elf_has_indirect_extern_access and elf_has_no_copy_on_protected
	when seeing GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
	(elf_write_gnu_propertie): Add an argument to pass link_info.
	Set needed_1_p for GNU_PROPERTY_1_NEEDED in memory.
	(_bfd_elf_link_setup_gnu_properties): Handle
	GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS for
	-z indirect-extern-access.  Set nocopyreloc to true and
	extern_protected_data to false for indirect external access.
	(_bfd_elf_convert_gnu_properties): Updated.
	* elf32-i386.c (elf_i386_check_relocs): Set
	non_got_ref_without_indirect_extern_access on legacy non-GOT or
	non-PLT references.
	* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
	* elflink.c (_bfd_elf_symbol_refs_local_p): Return true for
	STV_PROTECTED symbols with indirect external access.
	* elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Clear
	indirect_extern_access for legacy non-GOT/non-PLT references.
	* elfxx-x86.h (elf_x86_link_hash_entry): Add
	non_got_ref_without_indirect_extern_access.

include/

	* bfdlink.h (bfd_link_info): Add indirect_extern_access and
	needed_1_p.  Change nocopyreloc to int.

ld/

	* NEWS: Mention -z [no]indirect-extern-access
	* ld.texi: Document -z [no]indirect-extern-access
	* ldmain.c (main): Initialize link_info.indirect_extern_access
	to -1.
	* emulparams/extern_protected_data.sh: Support
	-z [no]indirect-extern-access.
	* testsuite/ld-elf/indirect-extern-access-1.rd: New file
	* testsuite/ld-elf/indirect-extern-access-1a.c: Likewise.
	* testsuite/ld-elf/indirect-extern-access-1b.c: Likewise.
	* testsuite/ld-elf/indirect-extern-access-2.rd: Likewise.
	* testsuite/ld-elf/indirect-extern-access-2a.c: Likewise.
	* testsuite/ld-elf/indirect-extern-access-2b.c: Likewise.
	* testsuite/ld-elf/indirect-extern-access-3.rd: Likewise.
	* testsuite/ld-elf/indirect-extern-access.S: Likewise.
	* testsuite/ld-elf/property-1_needed-1b.d: Likewise.
	* testsuite/ld-elf/property-1_needed-1c.d: Likewise.
	* testsuite/ld-x86-64/indirect-extern-access.rd: Likewise.
	* testsuite/ld-x86-64/protected-data-1.h: Likewise.
	* testsuite/ld-x86-64/protected-data-1a.c: Likewise.
	* testsuite/ld-x86-64/protected-data-1b.c: Likewise.
	* testsuite/ld-x86-64/protected-data-2a.S: Likewise.
	* testsuite/ld-x86-64/protected-data-2b.S: Likewise.
	* testsuite/ld-x86-64/protected-func-2a.S: Likewise.
	* testsuite/ld-x86-64/protected-func-2b.S: Likewise.
	* testsuite/ld-x86-64/protected-func-2c.c: Likewise.
	* testsuite/ld-elf/linux-x86.exp: Run test with
	GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
	* testsuite/ld-x86-64/x86-64.exp: Run tests for protected
	function and data with indirect external access.
2021-07-08 18:14:31 -07:00
..
aarch64cloudabi.sh
aarch64cloudabib.sh
aarch64elf32.sh
aarch64elf32b.sh
aarch64elf.sh
aarch64elfb.sh
aarch64fbsd.sh
aarch64fbsdb.sh
aarch64linux32.sh
aarch64linux32b.sh
aarch64linux.sh
aarch64linuxb.sh
aix5ppc.sh
aix5rs6.sh
aixppc.sh
aixrs6.sh
alpha.sh
alphavms.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
arc-endianness.sh
arc-nps.sh
arcelf.sh
arclinux_nps.sh
arclinux.sh
arcv2elf.sh
arcv2elfx.sh
arm_wince_pe.sh
armelf_fbsd.sh
armelf_fuchsia.sh
armelf_linux_eabi.sh
armelf_linux_fdpiceabi.sh
armelf_linux.sh
armelf_nacl.sh
armelf_nbsd.sh
armelf_phoenix.sh
armelf_vxworks.sh
armelf.sh ELF: Support .noinit and .persistent sections 2020-11-27 10:45:35 +00:00
armelfb_fbsd.sh
armelfb_fuchsia.sh
armelfb_linux_eabi.sh
armelfb_linux_fdpiceabi.sh
armelfb_linux.sh
armelfb_nacl.sh
armelfb_nbsd.sh
armelfb.sh
armnto.sh
armpe.sh
avr1.sh
avr2.sh
avr3.sh
avr4.sh
avr5.sh
avr6.sh
avr25.sh
avr31.sh
avr35.sh
avr51.sh
avrtiny.sh
avrxmega1.sh
avrxmega2.sh
avrxmega3.sh
avrxmega4.sh
avrxmega5.sh
avrxmega6.sh
avrxmega7.sh
call_nop.sh Use bool in ld 2021-03-31 10:49:23 +10:30
cet.sh Use bool in ld 2021-03-31 10:49:23 +10:30
crisaout.sh
criself.sh
crislinux.sh
cskyelf_linux.sh CSKY: Change default linker script for elf toolchain. 2020-10-26 17:13:21 +08:00
cskyelf.sh CSKY: Change default linker script for elf toolchain. 2020-10-26 17:13:21 +08:00
d10velf.sh
d30v_e.sh
d30v_o.sh
d30velf.sh
dynamic_undefined_weak.sh Use bool in ld 2021-03-31 10:49:23 +10:30
elf32_dlx.sh
elf32_sparc_sol2.sh
elf32_sparc_vxworks.sh
elf32_sparc.sh
elf32_spu.sh
elf32_tic6x_be.sh
elf32_tic6x_elf_be.sh
elf32_tic6x_elf_le.sh
elf32_tic6x_le.sh
elf32_tic6x_linux_be.sh
elf32_tic6x_linux_le.sh
elf32_x86_64.sh ld/x86: Add -z report-relative-reloc 2021-01-15 18:07:07 -08:00
elf32am33lin.sh
elf32b4300.sh Use bool in ld 2021-03-31 10:49:23 +10:30
elf32bfin.sh
elf32bfinfd.sh
elf32bmip.sh
elf32bmipn32-defs.sh
elf32bmipn32.sh
elf32briscv_ilp32.sh RISC-V: Implement support for big endian targets. 2021-01-06 17:57:52 +08:00
elf32briscv_ilp32f.sh RISC-V: Implement support for big endian targets. 2021-01-06 17:57:52 +08:00
elf32briscv.sh RISC-V: Implement support for big endian targets. 2021-01-06 17:57:52 +08:00
elf32bsmip.sh
elf32btsmip_fbsd.sh
elf32btsmip.sh
elf32btsmipn32_fbsd.sh
elf32btsmipn32.sh
elf32cr16.sh
elf32crx.sh
elf32ebmip.sh
elf32ebmipvxworks.sh
elf32elmip.sh
elf32elmipvxworks.sh
elf32epiphany_4x4.sh
elf32epiphany.sh
elf32fr30.sh
elf32frv.sh
elf32frvfd.sh
elf32ft32.sh
elf32ip2k.sh
elf32iq10.sh
elf32iq2000.sh
elf32l4300.sh
elf32lm32.sh Use bool in ld 2021-03-31 10:49:23 +10:30
elf32lm32fd.sh
elf32lmip.sh
elf32lppc.sh
elf32lppclinux.sh
elf32lppcnto.sh
elf32lppcsim.sh
elf32lr5900.sh Use bool in ld 2021-03-31 10:49:23 +10:30
elf32lr5900n32.sh Use bool in ld 2021-03-31 10:49:23 +10:30
elf32lriscv_ilp32.sh
elf32lriscv_ilp32f.sh
elf32lriscv-defs.sh RISC-V: Support GNU indirect functions. 2020-10-16 10:11:18 +08:00
elf32lriscv.sh
elf32lsmip.sh
elf32ltsmip_fbsd.sh
elf32ltsmip.sh
elf32ltsmipn32_fbsd.sh
elf32ltsmipn32.sh
elf32m32c.sh
elf32mb_linux.sh
elf32mbel_linux.sh
elf32mcore.sh
elf32mep.sh
elf32metag.sh
elf32microblaze.sh
elf32microblazeel.sh
elf32mipswindiss.sh
elf32moxie.sh
elf32mt.sh
elf32or1k_linux.sh
elf32or1k.sh
elf32ppc_fbsd.sh
elf32ppc.sh
elf32ppccommon.sh
elf32ppclinux.sh
elf32ppcnto.sh
elf32ppcsim.sh
elf32ppcvxworks.sh
elf32ppcwindiss.sh
elf32rl78.sh
elf32rx_linux.sh ld: Add rx-linux emulation. gas: Change ELF flags initial value in rx-linux 2020-04-30 13:35:37 +01:00
elf32rx.sh
elf32tilegx_be.sh
elf32tilegx.sh
elf32tilepro.sh
elf32vax.sh
elf32visium.sh Use bool in ld 2021-03-31 10:49:23 +10:30
elf32xc16x.sh
elf32xc16xl.sh
elf32xc16xs.sh
elf32xstormy16.sh
elf32xtensa.sh
elf32z80.sh
elf64_aix.sh
elf64_ia64_fbsd.sh
elf64_ia64_vms.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
elf64_ia64.sh
elf64_s390.sh
elf64_sparc_fbsd.sh
elf64_sparc_sol2.sh
elf64_sparc.sh
elf64alpha_fbsd.sh
elf64alpha_nbsd.sh
elf64alpha.sh
elf64bmip-defs.sh
elf64bmip.sh
elf64bpf.sh
elf64briscv_lp64.sh RISC-V: Implement support for big endian targets. 2021-01-06 17:57:52 +08:00
elf64briscv_lp64f.sh RISC-V: Implement support for big endian targets. 2021-01-06 17:57:52 +08:00
elf64briscv.sh RISC-V: Implement support for big endian targets. 2021-01-06 17:57:52 +08:00
elf64btsmip_fbsd.sh
elf64btsmip.sh
elf64hppa.sh
elf64lppc_fbsd.sh PR26667, Add powerpc64le-*-freebsd* support 2020-10-06 17:09:27 +10:30
elf64lppc.sh
elf64lriscv_lp64.sh
elf64lriscv_lp64f.sh
elf64lriscv-defs.sh
elf64lriscv.sh
elf64ltsmip_fbsd.sh
elf64ltsmip.sh
elf64mmix.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
elf64ppc_fbsd.sh
elf64ppc.sh
elf64rdos.sh
elf64tilegx_be.sh
elf64tilegx.sh
elf_fbsd.sh
elf_i386_be.sh
elf_i386_fbsd.sh
elf_i386_ldso.sh
elf_i386_sol2.sh
elf_i386_vxworks.sh
elf_i386.sh ld/x86: Add -z report-relative-reloc 2021-01-15 18:07:07 -08:00
elf_iamcu.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
elf_k1om_fbsd.sh
elf_k1om.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
elf_l1om_fbsd.sh
elf_l1om.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
elf_nacl.sh
elf_s390.sh
elf_x86_64_cloudabi.sh
elf_x86_64_fbsd.sh
elf_x86_64_sol2.sh
elf_x86_64.sh Use bool in ld 2021-03-31 10:49:23 +10:30
extern_protected_data.sh elf: Add GNU_PROPERTY_1_NEEDED check 2021-07-08 18:14:31 -07:00
h8300elf_linux.sh
h8300elf.sh
h8300helf_linux.sh
h8300helf.sh
h8300hnelf.sh
h8300self_linux.sh
h8300self.sh
h8300snelf.sh
h8300sxelf_linux.sh
h8300sxelf.sh
h8300sxnelf.sh
hppa64linux.sh
hppaelf.sh
hppalinux.sh
hppanbsd.sh
hppaobsd.sh
i386aout.sh
i386beos.sh
i386bsd.sh
i386go32.sh
i386lynx.sh
i386moss.sh
i386msdos.sh
i386nto.sh
i386pe_posix.sh
i386pe.sh
i386pep.sh
m9s12zelf.sh
m32relf_linux.sh
m32relf.sh
m32rlelf_linux.sh
m32rlelf.sh
m68hc11elf.sh
m68hc11elfb.sh
m68hc12elf.sh
m68hc12elfb.sh
m68kelf.sh
m68kelfnbsd.sh
mcorepe.sh
mmo.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
mn10200.sh
mn10300.sh
moxiebox.sh
msp430elf.sh
msp430X.sh
nds32belf16m.sh
nds32belf_linux.sh
nds32belf.sh
nds32elf16m.sh
nds32elf_linux.sh
nds32elf.sh
nios2elf.sh
nios2linux.sh
ns32knbsd.sh
pc532macha.sh
pdp11.sh PR27226, ld.bfd contains huge .rodata section 2021-01-26 20:54:43 +10:30
pjelf.sh
pjlelf.sh
plt_unwind.sh Use bool in ld 2021-03-31 10:49:23 +10:30
ppcmacos.sh
pruelf.sh
README Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
reloc_overflow.sh Use bool in ld 2021-03-31 10:49:23 +10:30
score3_elf.sh
score7_elf.sh
sh.sh
shelf_fd.sh
shelf_linux.sh
shelf_nbsd.sh
shelf_nto.sh
shelf_uclinux.sh
shelf_vxworks.sh
shelf.sh
shl.sh
shlelf_fd.sh
shlelf_linux.sh
shlelf_nbsd.sh
shlelf_nto.sh
shlelf_vxworks.sh
shlelf.sh
shpe.sh
solaris2.sh
static.sh Use bool in ld 2021-03-31 10:49:23 +10:30
tic3xcoff_onchip.sh
tic3xcoff.sh
tic4xcoff.sh
tic30coff.sh
tic54xcoff.sh
v850_rh850.sh
v850.sh
vanilla.sh
vaxnbsd.sh
vxworks.sh
x86-64-lam.sh Use bool in ld 2021-03-31 10:49:23 +10:30
x86-64-level.sh Fix compile time warning 2020-11-03 08:56:27 +00:00
x86-report-relative.sh ld/x86: Add -z report-relative-reloc 2021-01-15 18:07:07 -08:00
xgateelf.sh
z80.sh
z8001.sh
z8002.sh

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.

The files in this directory are read by genscripts.sh as shell commands.
They set parameters for the emulations.

Copyright (C) 2012-2021 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.