Go to file
Cui, Lili d774bf9b36 x86: Add tls check in gas
Assembler shouldn't accept invalid TLS instructions, TLS relocations
can only be used with specific instructions as specified in TLS psABI
and linker issues an error when TLS relocations are used with wrong
instructions or format. Since it is inconvenient for gcc to rely on
linker to report errors, adding TLS check in the assembler stage so
that gcc can know TLS errors earlier.

gas/ChangeLog:

        PR gas/32022
        * config.in: Regenerate.
        * config/tc-i386.c
        *(enum x86_tls_error_type): New.
        *(struct _i386_insn): Added has_gotrel to indicate whether TLS
	relocations need to be checked.
        (x86_check_tls_relocation): Added a new function to check TLS
	relocation.
        (x86_report_tls_error): Created a new function to report TLS error.
        (i386_assemble): Handle x86_check_tls_relocation.
        (lex_got): Set i.has_gotrel.
        (OPTION_MTLS_CHECK): Added a new option to contrl TLS check.
        (struct option): Ditto.
        (md_parse_option): Ditto.
        (md_show_usage): Ditto.
        * configure.ac: Added a new option to check TLS relocation by
	default.
        * configure: Regenerated.
        * doc/c-i386.texi: Document -mtls-check=.
        * testsuite/gas/i386/i386.exp: Added new tests.
        * testsuite/gas/i386/ilp32/ilp32.exp: Ditto.
        * testsuite/gas/i386/ilp32/reloc64.d: Disable TLS check for it.
        * testsuite/gas/i386/ilp32/x32-tls.d: Ditto.
        * testsuite/gas/i386/inval-tls.l: Added more test cases.
        * testsuite/gas/i386/inval-tls.s: Ditto.
        * testsuite/gas/i386/reloc32.d: Disable TLS check for it.
        * testsuite/gas/i386/reloc64.d: Ditto.
        * testsuite/gas/i386/x86-64-inval-tls.l: Added more test cases.
        * testsuite/gas/i386/x86-64-inval-tls.s: Ditto.
        * testsuite/gas/i386/x86-64.exp: Added new tests.
        * testsuite/gas/i386/ilp32/x32-inval-tls.l: New test.
        * testsuite/gas/i386/ilp32/x32-inval-tls.s: Ditto.
        * testsuite/gas/i386/ilp32/x86-64-tls.d: Ditto.
        * testsuite/gas/i386/tls.d: Ditto.
        * testsuite/gas/i386/tls.s: Ditto.
        * testsuite/gas/i386/x86-64-tls.d: Ditto.
        * testsuite/gas/i386/x86-64-tls.s: Ditto.

ld/ChangeLog:

        PR gas/32022
        * testsuite/ld-i386/tlsgdesc1.d: Disable TLS check for it.
        * testsuite/ld-i386/tlsgdesc2.d: Ditto.
        * testsuite/ld-i386/tlsie2.d: Ditto.
        * testsuite/ld-i386/tlsie3.d: Ditto.
        * testsuite/ld-i386/tlsie4.d: Ditto.
        * testsuite/ld-i386/tlsie5.d: Ditto.
        * testsuite/ld-i386/tlsgdesc3.d: Ditto.
        * testsuite/ld-x86-64/tlsdesc3.d: Ditto.
        * testsuite/ld-x86-64/tlsdesc4.d: Ditto.
        * testsuite/ld-x86-64/tlsie2.d: Ditto.
        * testsuite/ld-x86-64/tlsie3.d: Ditto.
        * testsuite/ld-x86-64/tlsie5.d: Ditto.
        * testsuite/ld-x86-64/tlsdesc5.d: Ditto.
2024-09-21 05:19:16 +08:00
bfd Automatic date update in version.in 2024-09-20 00:00:09 +00:00
binutils
config
contrib
cpu
elfcpp
etc
gas x86: Add tls check in gas 2024-09-21 05:19:16 +08:00
gdb gdb: fully separate coff and elf reading from dbx 2024-09-20 17:02:16 -03:00
gdbserver
gdbsupport gdbsupport/intrusive-list: add owning_intrusive_list 2024-09-13 07:38:56 -04:00
gnulib
gold
gprof
gprofng Fix 32096 UBSAN issues in gprofng 2024-09-18 20:24:24 -07:00
include MIPS/opcodes: Rework documentation for instruction args 2024-09-15 13:27:33 +01:00
ld x86: Add tls check in gas 2024-09-21 05:19:16 +08:00
libbacktrace
libctf
libdecnumber
libiberty
libsframe
opcodes x86/APX: Don't promote AVX/AVX2 instructions out of APX spec 2024-09-18 10:11:02 +08:00
readline
sim
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
.pre-commit-config.yaml
ar-lib
ChangeLog
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
SECURITY.txt
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.