LoongArch: Fix some test failures about TLS desc and TLS relaxation
authorXi Ruoyao <xry111@xry111.site>
Fri, 19 Jan 2024 16:38:24 +0000 (00:38 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Thu, 25 Jan 2024 01:23:49 +0000 (09:23 +0800)
commit54cdc63d5836343fe9b5011d722caf414885b813
treef50e33a01720fe4b39405bbed101474ba4c734ed
parentd895955b8bd6396f1195cf55f824b7fbc972ba63
LoongArch: Fix some test failures about TLS desc and TLS relaxation

There are two issues causing 11 test failures:

1. The TLS desc tests are matching the entire disassemble of a linked
   executable.  But if ld is configured --enable-default-hash-style=gnu
   (note that most modern distros use this option), the layout of the
   linked executables will be different and the immediate operands in
   the linked executables will also be different.  So we add
   "--hash-style=both" for these tests to cancel the effect of
   --enable-default-hash-style=gnu, like [x86_64 mark-plt tests].
2. By default objdump disassemble uses [pseudo-instructions] so "addi.w"
   is outputed as "li.w", causing mismatches in TLS relaxation tests.
   We can turn off the pseudo-instruction usage in objdump using "-M
   no-aliases" to fix them.

[x86_64 mark-plt tests]: 16666ccc91295d1568c5c2cb0e7600694840dfd9
[pseudo-instructions]: 17f9439038257b1de0c130a416a9a7645c653cb0

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
ld/testsuite/ld-loongarch-elf/desc-ie.d
ld/testsuite/ld-loongarch-elf/desc-norelax.d
ld/testsuite/ld-loongarch-elf/desc-relax.d
ld/testsuite/ld-loongarch-elf/relax.exp
ld/testsuite/ld-loongarch-elf/tlsdesc-dso.d