]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add linker tests for TLS changes
authorMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 5 Aug 2022 16:19:37 +0000 (17:19 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 5 Aug 2022 16:50:11 +0000 (17:50 +0100)
commita744244852b3886f7bba68638c0090f755a631d7
treeff735834540767990f89a2869ec713bac10804d3
parent26c322950fd6ea66cf47677542c7e1d0361d0650
Add linker tests for TLS changes

This includes:
  - New tests for the new functionality for Morello TLS.
  - Adding target check for `-shared` to Morello tests that require
    a target that supports shared libraries.
  - Tests to ensure the extra error-checking emits errors when needed.
  - New tests for the new relocations defined for Morello TLS.
  - Some fixups for existing tests that don't seem like they deserve a
    separate commit.

Notes about some changes that seem like they require it:

tlsle-symbol-offset testcase:
  Do not use `-shared` as a linker argument.
  This testcase is checking for Local-Exec relocations, using these
  relocations in a shared library is simply not valid.  AFAICS there's
  no need for the `-shared` flag in this testcase, since it's just there
  to check that the tls LE relocations accept an addend.

  This was working before since we did not error on such things, but
  with the extra hardening that I've added we are now erroring on them.

morello-sec-start_stop-round testcase:
  We were originally searching for a specific __data_start symbol
  marking the start of the data section.  This was not part of what we
  actually wanted to test, and the symbol which was printed was
  different on aarch64-none-linux-gnu.  Hence we change our regex to
  search for any symbol to allow the test to pass on both targets.

morello-tlsie-overflow testcase:
  This testcase adds some padding in the .text section so that the GOT
  is very far away from the relocation which attempts to access it.
  This means that the relocation can not be satisfied and we can check
  for the resulting error message.
47 files changed:
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/emit-relocs-morello-2-a64c.d
ld/testsuite/ld-aarch64/emit-relocs-morello-2.d
ld/testsuite/ld-aarch64/emit-relocs-morello-3-a64c.d
ld/testsuite/ld-aarch64/emit-relocs-morello-3.d
ld/testsuite/ld-aarch64/emit-relocs-morello-a64c.d
ld/testsuite/ld-aarch64/emit-relocs-morello-hidden.d
ld/testsuite/ld-aarch64/emit-relocs-morello.d
ld/testsuite/ld-aarch64/illegal-tlsle-pde.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/illegal-tlsle-pde.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-dt-init-fini.d
ld/testsuite/ld-aarch64/morello-dynamic-got.d
ld/testsuite/ld-aarch64/morello-illegal-size-relocs-pie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-size-relocs-shared.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-size-relocs.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-size-relocs.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-tls-pde.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-tls-pde.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-tls-pie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-tls-shared.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-tls.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-illegal-tls.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-sec-start_stop-round.d
ld/testsuite/ld-aarch64/morello-size-relocs-pie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-size-relocs-shared.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-size-relocs.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-size-relocs.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-stubs.d
ld/testsuite/ld-aarch64/morello-tls-pde.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tls-pde.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsdesc-seen-ie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsdesc-seen-ie.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsdesc-static.d
ld/testsuite/ld-aarch64/morello-tlsdesc-staticpie.d
ld/testsuite/ld-aarch64/morello-tlsdesc.d
ld/testsuite/ld-aarch64/morello-tlsdesc.s
ld/testsuite/ld-aarch64/morello-tlsie-overflow.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsie-overflow.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsie-pie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsie-shared.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsie.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsle-pie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsle.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-tlsle.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/tls-shared.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/tlsle-symbol-offset.d