1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00
Commit Graph

3769 Commits

Author SHA1 Message Date
Rui Ueyama
e6d4154688 [ELF] Generalize tests
With this change, you can now cross compile test cases and run
them on qemu-user. Here is an example to run our test suits in
an emulated ARM32 environment.

$ CC=arm-linux-gnueabihf-gcc \
  CXX=arm-linux-gnueabihf-g++ \
  GCC=arm-linux-gnueabihf-gcc \
  GXX=arm-linux-gnueabihf-g++ \
  OBJDUMP=arm-linux-gnueabihf-objdump \
  MACHINE=arm \
  QEMU='qemu-arm -L /usr/arm-linux-gnueabihf' \
  make -j16 test
2022-04-02 16:53:41 +08:00
Rui Ueyama
60eae9ed20 [ELF][ARM32] Support R_ARM_GOT_PREL 2022-04-02 01:46:48 +00:00
Rui Ueyama
7fb1b1b9ec
Merge pull request #399 from alois31/r_aarch64_ld_prel_lo19
[ELF][ARM64] Support R_AARCH64_LD_PREL_LO19 relocations
2022-04-01 13:44:39 +08:00
Rui Ueyama
0ecd72900e Attempt to fix CI 2022-04-01 13:32:01 +08:00
Rui Ueyama
9eb4e76daf Attempt to fix CI 2022-04-01 13:20:17 +08:00
Rui Ueyama
b6876b5640 Update comment 2022-04-01 13:12:27 +08:00
Rui Ueyama
f4753b34bf [ELF] Fix use-after-free found by ASAN 2022-04-01 13:12:10 +08:00
Rui Ueyama
8196199cac Refactor 2022-04-01 12:52:21 +08:00
Rui Ueyama
2a3ee11b7d
Merge pull request #400 from nick-rawlings/parse_unsigned_number
image-base i64 to u64 parse_unsigned_number
2022-04-01 12:36:44 +08:00
Rui Ueyama
68f2a26987 Refactor 2022-04-01 02:49:57 +00:00
Rui Ueyama
227a6c8a88 [ELF][ARM32] Fix TLSDESC relocations 2022-04-01 02:47:29 +00:00
Rui Ueyama
fe617c3618 [ELF][ARM32] Support R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS 2022-04-01 02:47:29 +00:00
Rui Ueyama
e3a7c9e017 [ELF][RISCV] Disable a test that doesn't work with RISCV64 2022-03-31 13:24:34 +00:00
Rui Ueyama
5ee6f89544 Revert "Attempt to fix a build issue with libc++14"
This reverts commit 8e3cee958b
because it broke the RISC-V target.
2022-03-31 13:24:19 +00:00
Rui Ueyama
40c2ad7839 [ELF][RISCV64] Fix tests 2022-03-31 08:16:07 +00:00
Rui Ueyama
5edd07efd9 Refactor 2022-03-31 01:47:56 +00:00
Rui Ueyama
8e5def28ce Refactor 2022-03-31 00:46:33 +00:00
Rui Ueyama
b534d5af27 Add comments 2022-03-30 14:11:34 +00:00
Rui Ueyama
673f531adb Add comments 2022-03-30 13:57:17 +00:00
Rui Ueyama
66d3de438c Attempt to fix CI 2022-03-30 09:36:38 +00:00
Rui Ueyama
d9ea875677 [ELF][ARM32] Implement many relocations
With this change, most tests in test/elf/ directory pass on ARM32.
2022-03-30 09:26:32 +00:00
Rui Ueyama
577361478a Fix CI
This reverts commit 408e2bfee8.
2022-03-29 11:23:30 +00:00
Rui Ueyama
408e2bfee8 Improve tests 2022-03-29 06:47:17 +00:00
Rui Ueyama
9ac23730b7
Merge pull request #408 from yurai007/fix-some-ubsan-errors
[ELF] Fix issues caught by UBSan
2022-03-28 16:39:24 +08:00
Dawid Jurczak
bf26753bbd [ELF] Fix issues caught by UBSan
While running tests on UBSan instrumented mold binary 2 separated problems are reported:

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior elf/main.cc:592:15 in
elf/output-chunks.cc:1866:24: runtime error: member call on null pointer of type 'mold:🧝:VerdefSection<mold:🧝:X86_64> *'

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior elf/output-chunks.cc:1866:24 in
elf/input-files.cc:1000:8: runtime error: load of value 190, which is not a valid value for type 'bool'

This change fixes both of them.

Signed-off-by: Dawid Jurczak <dawid_jurek@vp.pl>
2022-03-28 09:43:28 +02:00
Rui Ueyama
8e3cee958b Attempt to fix a build issue with libc++14
https://github.com/rui314/mold/issues/407
2022-03-27 08:15:25 +00:00
Rui Ueyama
05f4a43c8f [ELF][ARM64] Allow TLSGD relocations in statically-linked executables 2022-03-27 07:48:42 +00:00
Rui Ueyama
ca227fb8da Refactor 2022-03-27 06:58:28 +00:00
Rui Ueyama
78e4b06cb8 Fix a regression 2022-03-26 01:19:28 +00:00
Rui Ueyama
94cace7fc1 Refactor 2022-03-25 11:46:34 +00:00
Rui Ueyama
812c59fd5c Refactor 2022-03-23 15:00:29 +00:00
Rui Ueyama
8770bd775b [ELF][ARM] Fix test 2022-03-23 14:54:26 +00:00
Rui Ueyama
89d43f2673 Fix test
So that this test works on ARM32.
2022-03-23 14:41:40 +00:00
Rui Ueyama
632a2ec1b4 [ELF][ARM] Set e_flags to EABI version 5
All binaries should have this version now. GNU binutils do not allow
users to link EABI version 5 object fiels to EABI version 0 DSOs.
2022-03-23 14:38:06 +00:00
Rui Ueyama
6af78bf17b [ELF][ARM32] Do not keep .ARM.attributes sections
ARM32 object files usually contain a .ARM.attributes section.
We need to parse and merge .ARM.attributes sections.
But for now, we just remove them from inputs.
2022-03-23 14:11:14 +00:00
Rui Ueyama
9360267cc3 Refactor 2022-03-23 11:18:27 +00:00
Rui Ueyama
66b995b5a9 [ELF][ARM32] Remove unsupported relocations 2022-03-23 09:11:31 +00:00
Rui Ueyama
94e2d7d6dc [ELF][ARM32] Fix R_ARM_THM_CALL relocation 2022-03-23 08:43:27 +00:00
Rui Ueyama
759aa95618 [ELF][ARM32] Fix R_ARM_THM_MOVT_ABS relocation 2022-03-23 03:12:29 +00:00
Rui Ueyama
575a604d5d [ELF][ARM32] Handle relocations against non-alloc sections 2022-03-23 01:44:19 +00:00
Rui Ueyama
ac9a1c4048 [ELF][ARM32] Add a link to a documentation 2022-03-23 00:50:26 +00:00
Rui Ueyama
d5cf590498 [ELF][ARM32] Support basic relocations
With this change, mold can link dynamically-linked "Hello world"
program for ARM32.
2022-03-22 12:52:07 +00:00
Rui Ueyama
18656091f6 Rename a test 2022-03-22 12:24:10 +00:00
Rui Ueyama
ead32811b3 Fix a test for AArch64
Currently, we do not support relaxations of TLS GD/LD relocations
for ARM64. This is in practice not a problem because TLSDESC is used
on ARM64 by default.

However, there's one situation in which not supporting TLS GD/LD
relaxation becomes an issue; static linking. If an executable is
statically-linked, relaxation is mandatory because we can't generate
dynamic relocations for GD/LD relocations.

In this patch, we simply report an error if an object file compiled
with TLS GD/LD is used for creating a statically-linked executable.

This commit fixes all tests on ARM64.
2022-03-21 02:49:50 +00:00
Rui Ueyama
7cdfa31e6c Refactor 2022-03-20 14:21:46 +00:00
Rui Ueyama
a6e4676a71
Merge pull request #401 from yurai007/do-not-hardcode-GCC-version-in-tests
[ELF][RISC-V] Do not hardcode GCC version in tests
2022-03-20 09:25:43 +08:00
Dawid Jurczak
0c88d323c8 [ELF][RISC-V] Do not hardcode GCC version in tests
Signed-off-by: Dawid Jurczak <dawid_jurek@vp.pl>
2022-03-19 17:22:03 +01:00
Rui Ueyama
326150a182
Merge pull request #390 from mrichtarsky/main
Improve help
2022-03-19 22:39:52 +08:00
nick-rawlings
339816702d Update cmdline.cc
use stoul for unsigned long

image-base i64 to u64 parse_unsigned_number

Signed-off-by: nick-rawlings <100548346+nick-rawlings@users.noreply.github.com>
2022-03-17 21:28:10 -05:00
Alois Wohlschlager
146ddd711c
[ELF][ARM64] Support R_AARCH64_LD_PREL_LO19 relocations
Implement support for the R_AARCH64_LD_PREL_LO19 relocation type. Since
this actually behaves the same way as R_AARCH64_CONDBR19, reuse the
relevant code.

Signed-off-by: Alois Wohlschlager <alois1@gmx-topmail.de>
2022-03-17 15:44:49 +01:00