binutils-gdb/include
H.J. Lu 3d5a60de52 x86-64: Add R_X86_64_CODE_4_GOTPCRELX
For

	mov        name@GOTPCREL(%rip), %reg
	test       %reg, name@GOTPCREL(%rip)
	binop      name@GOTPCREL(%rip), %reg

where binop is one of adc, add, add, cmp, or, sbb, sub, xor instructions,
add

 # define R_X86_64_CODE_4_GOTPCRELX  43

if the instruction starts at 4 bytes before the relocation offset.  It
similar to R_X86_64_GOTPCRELX.  Linker can treat R_X86_64_CODE_4_GOTPCRELX
as R_X86_64_GOTPCREL or convert the above instructions to

	lea	name(%rip), %reg
	mov	$name, %reg
	test	$name, %reg
	binop	$name, %reg

if the instruction is encoded with the REX2 prefix when possible.

bfd/

	* elf64-x86-64.c (x86_64_elf_howto_table): Add
	R_X86_64_CODE_4_GOTPCRELX.
	(R_X86_64_standard): Updated.
	(x86_64_reloc_map): Add BFD_RELOC_X86_64_CODE_4_GOTPCRELX.
	(elf_x86_64_convert_load_reloc): Handle R_X86_64_CODE_4_GOTPCRELX.
	(elf_x86_64_scan_relocs): Likewise.
	(elf_x86_64_relocate_section): Likewise.
	* reloc.c (bfd_reloc_code_real): Add
	BFD_RELOC_X86_64_CODE_4_GOTPCRELX.
	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.

gas/

	* write.h (fix): Add fx_tcbit3.  Change fx_unused to 1 bit.
	* config/tc-i386.c (tc_i386_fix_adjustable): Handle
	BFD_RELOC_X86_64_CODE_4_GOTPCRELX.
	(tc_gen_reloc): Likewise.
	(output_disp): Set fixP->fx_tcbit3 for REX2 prefix.
	(i386_validate_fix): Generate BFD_RELOC_X86_64_CODE_4_GOTPCRELX
	if fixp->fx_tcbit3 is set.
	* config/tc-i386.h (TC_FORCE_RELOCATION_LOCAL): Add
	BFD_RELOC_X86_64_CODE_4_GOTPCRELX.
	(TC_FORCE_RELOCATION_ABS): Likewise.
	* testsuite/gas/i386/x86-64-gotpcrel.s: Add tests for
	R_X86_64_CODE_4_GOTPCRELX.
	* testsuite/gas/i386/x86-64-localpic.s: Likewise.
	* testsuite/gas/i386/x86-64-gotpcrel.d: Updated.
	* testsuite/gas/i386/x86-64-localpic.d: Likewise.
	* testsuite/gas/i386/ilp32/x86-64-localpic.d: Likewise.

include/

	* elf/x86-64.h (elf_x86_64_reloc_type): Add
	R_X86_64_CODE_4_GOTPCRELX.

ld/

	* testsuite/ld-x86-64/apx-load1.s: New file.
	* testsuite/ld-x86-64/apx-load1a.d: Likewise.
	* testsuite/ld-x86-64/apx-load1b.d: Likewise.
	* testsuite/ld-x86-64/apx-load1c.d: Likewise.
	* testsuite/ld-x86-64/apx-load1d.d: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run apx-load1a, apx-load1b,
	apx-load1c and apx-load1d.
2023-12-28 08:47:17 -08:00
..
aout Delete include/aout/encap.h 2023-05-30 12:51:22 +09:30
cgen Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
coff Add basic support for RISC-V 64-bit EFI objects 2023-12-05 13:20:27 +01:00
elf x86-64: Add R_X86_64_CODE_4_GOTPCRELX 2023-12-28 08:47:17 -08:00
gdb Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
mach-o Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
opcode Support APX GPR32 with rex2 prefix 2023-12-28 11:14:41 +00:00
sim sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
som Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
vms Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
alloca-conf.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ansidecl.h c++: source position of lambda captures [PR84471] 2023-08-12 09:58:22 +09:30
bfdlink.h Add ability to change linker warning messages into errors when reporting executable stacks and/or executable segments. 2023-11-10 11:37:27 +00:00
binary-io.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
bout.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ChangeLog libiberty, ld: Use x86 HW optimized sha1 2023-11-28 13:29:58 +01:00
ChangeLog-0415 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-2016 ChangeLog rotation 2017-01-02 13:55:05 +10:30
ChangeLog-2017 ChangeLog rotation 2018-01-03 17:49:42 +10:30
ChangeLog-2018 ChangeLog rotation 2019-01-01 21:25:40 +10:30
ChangeLog-2019 ChangeLog rotation 2020-01-01 18:12:08 +10:30
ChangeLog-2020 ChangeLog rotation 2021-01-01 10:31:02 +10:30
ChangeLog-9103 Add copyright notices 2012-12-10 12:48:03 +00:00
collectorAPI.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
COPYING
COPYING3
ctf-api.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ctf.h ctf: fix various dreadful typos in the ctf_archive format comments 2023-01-12 14:40:47 +00:00
demangle.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
diagnostics.h gdbsupport: ignore -Wenum-constexpr-conversion in enum-flags.h 2023-03-06 21:00:52 -05:00
dis-asm.h kvx: New port. 2023-08-16 14:22:54 +01:00
dwarf2.def Add some new DW_IDX_* constants 2023-12-10 14:55:22 -07:00
dwarf2.h Updated constants from <https://dwarfstd.org/Languages.php> 2023-08-12 09:58:22 +09:30
dyn-string.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
environ.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
fibheap.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
filenames.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
floatformat.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
fnmatch.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
fopen-bin.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
fopen-same.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
fopen-vms.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
gcc-c-fe.def Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
gcc-c-interface.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
gcc-cp-fe.def Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
gcc-cp-interface.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
gcc-interface.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
getopt.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
hashtab.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
hp-symtab.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
leb128.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
libcollector.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
libfcollector.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
libiberty.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
longlong.h LoongArch: implement count_{leading,trailing}_zeros 2023-08-12 09:58:22 +09:30
lto-symtab.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
MAINTAINERS Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
md5.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
oasys.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
objalloc.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
obstack.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
os9k.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
partition.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
plugin-api.h PR29961, plugin-api.h: "Could not detect architecture endianess" 2023-05-17 11:21:43 +09:30
safe-ctype.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
sframe-api.h sframe: bfd: gas: ld: format bump to SFrame version 2 2023-06-29 16:31:58 -07:00
sframe.h sframe: bfd: gas: ld: format bump to SFrame version 2 2023-06-29 16:31:58 -07:00
sha1.h libiberty, ld: Use x86 HW optimized sha1 2023-11-28 13:29:58 +01:00
simple-object.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
sort.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
splay-tree.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
symcat.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
timeval-utils.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
vtv-change-permission.h Libvtv: Add loongarch support. 2023-08-12 09:58:22 +09:30
xregex2.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
xregex.h merge from gcc 2011-07-25 17:11:48 +00:00
xtensa-config.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
xtensa-dynconfig.h gcc: xtensa: add data alignment properties to dynconfig 2023-08-12 10:24:26 +09:30
xtensa-isa-internal.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
xtensa-isa.h Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30