Files
binutils-gdb/bfd
H.J. Lu a533c8df59 x86-64: Add R_X86_64_CODE_4_GOTTPOFF/R_X86_64_CODE_4_GOTPC32_TLSDESC
For

	add	name@gottpoff(%rip), %reg
	mov	name@gottpoff(%rip), %reg

add

 # define R_X86_64_CODE_4_GOTTPOFF	44

and for

	lea	name@tlsdesc(%rip), %reg

add

 # define R_X86_64_CODE_4_GOTPC32_TLSDESC	45

if the instruction starts at 4 bytes before the relocation offset.
They are similar to R_X86_64_GOTTPOFF and R_X86_64_GOTPC32_TLSDESC,
respectively.  Linker can covert GOTTPOFF to

	add	$name@tpoff, %reg
	mov	$name@tpoff, %reg

and GOTPC32_TLSDESC to

	mov	$name@tpoff, %reg
	mov	name@gottpoff(%rip), %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_GOTTPOFF and R_X86_64_CODE_4_GOTPC32_TLSDESC.
	(R_X86_64_standard): Updated.
	(x86_64_reloc_map): Add BFD_RELOC_X86_64_CODE_4_GOTTPOFF
	and BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC.
	(elf_x86_64_check_tls_transition): Handle R_X86_64_CODE_4_GOTTPOFF
	and R_X86_64_CODE_4_GOTPC32_TLSDESC.
	(elf_x86_64_tls_transition): Likewise.
	(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_GOTTPOFF and
	BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC.
	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.

gas/

	* config/tc-i386.c (tc_i386_fix_adjustable): Handle
	BFD_RELOC_X86_64_CODE_4_GOTTPOFF and
	BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC.
	(md_assemble): Handle BFD_RELOC_X86_64_CODE_4_GOTTPOFF.
	(output_insn): Don't add empty REX prefix with REX2 prefix.
	(output_disp): Handle BFD_RELOC_X86_64_CODE_4_GOTTPOFF and
	BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC.
	(md_apply_fix): Likewise.
	(i386_validate_fix): Generate BFD_RELOC_X86_64_CODE_4_GOTTPOFF or
	BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC if ixp->fx_tcbit3 is set.
	(tc_gen_reloc): Handle BFD_RELOC_X86_64_CODE_4_GOTTPOFF and
	BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC.
	* testsuite/gas/i386/x86-64-gottpoff.d: New file.
	* testsuite/gas/i386/x86-64-gottpoff.s: Likewise.
	* testsuite/gas/i386/x86-64-tlsdesc.d: Likewise.
	* testsuite/gas/i386/x86-64-tlsdesc.s: Likewise.

include/

	* elf/x86-64.h (elf_x86_64_reloc_type): Add
	R_X86_64_CODE_4_GOTTPOFF and R_X86_64_CODE_4_GOTPC32_TLSDESC

ld/

	* testsuite/ld-x86-64/tlsbindesc.d: Updated.
	* testsuite/ld-x86-64/tlsbindesc.rd: Likewise.
	* testsuite/ld-x86-64/tlsbindesc.s: Add R_X86_64_CODE_4_GOTTPOFF
	and R_X86_64_CODE_4_GOTPC32_TLSDESC tests.
2023-12-28 08:47:17 -08:00
..
2023-11-07 17:47:16 -07:00
2023-01-02 14:03:22 +10:30
2023-12-11 14:45:54 +10:30
2023-11-15 12:53:04 +00:00
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-05-03 15:00:05 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-11-07 17:47:16 -07:00
2023-08-09 08:48:09 +09:30
2023-08-03 07:39:15 -06:00
2023-01-06 21:06:15 +10:30
2023-02-09 20:07:55 +10:30
2023-01-06 21:06:15 +10:30
2023-08-09 08:48:09 +09:30
2023-08-03 07:39:15 -06:00
2023-01-10 09:15:51 +10:30
2023-08-31 07:48:16 +09:30
2023-05-20 10:49:19 +09:30
2023-08-28 23:10:57 +09:30
2023-08-23 10:07:45 +09:30
2023-08-28 23:10:57 +09:30
2023-11-15 12:53:04 +00:00
2023-12-15 14:54:20 +00:00
2023-08-16 14:22:54 +01:00
2023-06-01 09:51:59 +09:30
2023-08-02 12:06:23 +01:00
2023-03-24 21:01:43 +10:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-05-17 11:21:43 +09:30
2023-06-14 14:24:50 +09:30
2023-05-17 11:21:43 +09:30
2023-10-06 10:52:02 +01:00
2023-08-02 12:06:23 +01:00
2023-08-09 08:48:09 +09:30
2023-08-04 17:59:01 +09:30
2023-09-20 08:23:47 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-16 14:22:54 +01:00
2023-12-11 10:42:59 +10:30
2023-06-07 14:16:06 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-01-10 09:15:51 +10:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-31 07:48:16 +09:30
2023-08-31 08:57:31 +09:30
2023-08-27 21:21:38 +09:30
2023-08-27 21:21:38 +09:30
2023-08-09 08:48:09 +09:30
2023-06-07 14:16:06 +09:30
2023-08-09 08:48:09 +09:30
2023-06-07 14:16:06 +09:30
2023-11-09 17:42:48 +01:00
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-03 07:39:15 -06:00
2023-08-03 07:39:15 -06:00
2023-08-11 16:36:11 +09:30
2023-08-03 07:39:15 -06:00
2023-08-03 07:39:15 -06:00
2023-08-03 07:39:15 -06:00
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-02 12:06:23 +01:00
2023-08-25 15:55:25 +09:30
2023-08-09 08:48:09 +09:30
2023-05-03 15:00:05 +09:30
2023-05-03 15:00:05 +09:30
2023-05-20 21:06:03 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-08-09 08:48:09 +09:30
2023-12-28 00:01:13 +00:00
2023-08-02 12:06:23 +01:00
2023-08-31 07:48:16 +09:30
2023-08-11 16:36:11 +09:30
2023-08-09 08:48:09 +09:30
2023-08-11 16:36:11 +09:30

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-2023 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.