mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 02:24:46 +08:00
d774bf9b36
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. |
||
---|---|---|
.. | ||
all.texi | ||
as.texi | ||
c-aarch64.texi | ||
c-alpha.texi | ||
c-arc.texi | ||
c-arm.texi | ||
c-avr.texi | ||
c-bfin.texi | ||
c-bpf.texi | ||
c-cr16.texi | ||
c-cris.texi | ||
c-csky.texi | ||
c-d10v.texi | ||
c-d30v.texi | ||
c-epiphany.texi | ||
c-h8300.texi | ||
c-hppa.texi | ||
c-i386.texi | ||
c-ia64.texi | ||
c-ip2k.texi | ||
c-kvx.texi | ||
c-lm32.texi | ||
c-loongarch.texi | ||
c-m32c.texi | ||
c-m32r.texi | ||
c-m68hc11.texi | ||
c-m68k.texi | ||
c-metag.texi | ||
c-microblaze.texi | ||
c-mips.texi | ||
c-mmix.texi | ||
c-msp430.texi | ||
c-mt.texi | ||
c-nds32.texi | ||
c-nios2.texi | ||
c-ns32k.texi | ||
c-or1k.texi | ||
c-pdp11.texi | ||
c-pj.texi | ||
c-ppc.texi | ||
c-pru.texi | ||
c-riscv.texi | ||
c-rl78.texi | ||
c-rx.texi | ||
c-s12z.texi | ||
c-s390.texi | ||
c-score.texi | ||
c-sh.texi | ||
c-sparc.texi | ||
c-tic6x.texi | ||
c-tic54x.texi | ||
c-tilegx.texi | ||
c-tilepro.texi | ||
c-v850.texi | ||
c-vax.texi | ||
c-visium.texi | ||
c-wasm32.texi | ||
c-xgate.texi | ||
c-xstormy16.texi | ||
c-xtensa.texi | ||
c-z8k.texi | ||
c-z80.texi | ||
fdl.texi | ||
h8.texi | ||
internals.texi | ||
local.mk |