1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-11 04:55:31 +03:00
Commit Graph

6469 Commits

Author SHA1 Message Date
Shiv Dhar
5bf1955fa9
Fix small typo 2024-03-02 01:36:05 +05:30
Rui Ueyama
c6e5e2c0a0 Dogfood setup-mold 2024-03-01 20:23:35 +09:00
Rui Ueyama
fb3c166f80 Bump mold version to 2.4.1 2024-03-01 11:30:05 +09:00
Rui Ueyama
39643aaf94 Fix GCC warning
Fixes https://github.com/rui314/mold/issues/1208
2024-03-01 10:44:35 +09:00
Rui Ueyama
50bdf39ba5 Mark shared symbols as weak if all references are weak
Previously, mold marked an imported symbol as a strong one if the
symbol came from a DSO and was exported as a strong symbol by the DSO.
This logic resulted in a miscomputation of the weakness bit, causing a
compatibility issue with other linkers.

Now, an imported symbol is marked as strong only when there's at least
one strong reference to it. In other words, if all references to an
imported symbol are weak, the symbol will be imported as a weak one.

Fixes https://github.com/llvm/llvm-project/issues/83080
2024-02-29 12:57:11 +09:00
Rui Ueyama
1e413d4121 Fix GCC warning
Fixes https://github.com/rui314/mold/issues/1205
2024-02-28 14:03:41 +09:00
Rui Ueyama
fcda712238 Attempt to fix GCC warnings
Fixes https://github.com/rui314/mold/issues/1204
2024-02-27 16:38:45 +09:00
Rui Ueyama
d4ff48a07e [PPC64V2] Emit _savegpr0_*, _restgpr0_*, _savegpr1_* and _restgpr1_* symbols
Fixes https://github.com/rui314/mold/issues/1203
2024-02-27 14:35:19 +09:00
Rui Ueyama
21f25545a8 Update README 2024-02-27 12:02:44 +09:00
Rui Ueyama
58558e319c RISC-V: Define __global_pointer$ for DSO
Fixes https://github.com/rui314/mold/issues/1182
2024-02-26 14:38:38 +09:00
Rui Ueyama
48f6a08352 Refactor 2024-02-26 12:29:27 +09:00
Rui Ueyama
01e9f42c10
Merge pull request #1198 from nga888/win-build-tidy
Minor fixes for the Windows build
2024-02-26 12:12:11 +09:00
Rui Ueyama
8c3967886c Remove code for the sold linker 2024-02-25 14:29:53 +09:00
Rui Ueyama
8a4fb3b445
Merge pull request #1199 from nga888/win-mem-map-file-handling
Fixes and improvements to Windows file handling and memory mapping
2024-02-25 12:58:08 +09:00
Rui Ueyama
04c9b62660 Update README 2024-02-24 15:08:05 +09:00
Rui Ueyama
4790349f79 Update README 2024-02-24 15:07:25 +09:00
Rui Ueyama
3e6005a1e7 Update benchmark results 2024-02-24 15:04:34 +09:00
Andrew Ng
9e3565027a Fixes and improvements to Windows file handling and memory mapping
Prior to this change, links on Windows were failing with:

  mold: fatal: <input file>: CreateFileMapping failed: 5

"5" is the Windows error code for ERROR_ACCESS_DENIED.

Use native Windows file API in MappedFile. Create read only mapping with
FILE_MAP_COPY view because the file mapping contents may be modified in
process but should not be written back.

On Windows, it is important that files are opened in "binary" mode to
avoid automatic "text" mode conversions which can result in "corrupted"
input/output.
2024-02-23 14:40:39 +00:00
Rui Ueyama
6d8e6afbf2 Fix R_PPC64_DTPREL16_LO_DS
Fixes https://github.com/rui314/mold/issues/1192
2024-02-23 17:14:25 +09:00
Rui Ueyama
5b5f431717 Fix CI 2024-02-22 09:13:26 +09:00
Andrew Ng
796e2556b6 Minor fixes for the Windows build
Removes some Windows build warnings.

Fixes conversion of Windows FILETIME to nsec in get_usage() used by
TimerRecord.
2024-02-21 15:24:07 +00:00
Rui Ueyama
8090737d56 Merge sections with different flags into a single section
Previously, mold didn't merge sections with the same name but different
section flags into a single section. This behavior is different from other
linkers and caused a compatibility issue.

Now, mold merges input sections by their names and types.

Fixes https://github.com/rui314/mold/issues/1196
2024-02-21 18:50:47 +09:00
Rui Ueyama
d39a0c7035 Refactor 2024-02-21 18:21:03 +09:00
Rui Ueyama
de696ba5a4 --repro: Do not try to reopen files with different paths
Fixes https://github.com/rui314/mold/issues/1197
2024-02-21 17:11:04 +09:00
Rui Ueyama
cefa2d9100 Add Red Hat Enterprise Linux
Fixes https://github.com/rui314/mold/issues/1191
2024-02-20 15:11:42 +09:00
Rui Ueyama
9f07fd035c Support R_PPC64_DTPREL16_LO_DS
Fixes https://github.com/rui314/mold/issues/1192
2024-02-20 13:07:02 +09:00
Rui Ueyama
7ead7231c9 Fix CI 2024-02-19 16:50:23 +09:00
Rui Ueyama
b0a3a5ce62 Drop SHF_COMPRESSED when creating a relocatable file
We always uncompress compressed sections when copying, so we should
not propagate the flag.

Fixes https://github.com/rui314/mold/issues/1195
2024-02-19 16:22:39 +09:00
Rui Ueyama
64c2084c8a Pass GCC offload data to the LTO backend
Fixes https://github.com/rui314/mold/issues/1190
2024-02-19 15:12:43 +09:00
Rui Ueyama
4c355239ad Refactor 2024-02-19 15:12:43 +09:00
Rui Ueyama
79169ea315 Format 2024-02-19 15:12:43 +09:00
Rui Ueyama
4db866d5c3
Merge pull request #1193 from gruenich/feature/range-loop-reference 2024-02-11 03:11:50 +09:00
Christoph Grüninger
83a5bfbfb1 elf/cmdline.cc: Add missing references in range-for loops
std::string is a non-trivial type, this change ensures its
copy-ctor and dtor don't get called.
Found by Clazy (range-loop-reference)


Signed-off-by: Christoph Grüninger <foss@grueninger.de>
2024-02-10 17:42:07 +01:00
Rui Ueyama
c9651d9b2b
Merge pull request #1187 from aokblast/fix/fileoffset 2024-02-04 00:37:32 +09:00
aokblast
8c99dd0f2c
Feat: use accumulate address on sections with SHT_ALLOC 2024-02-03 22:03:55 +08:00
Rui Ueyama
25351379ab Fix CI 2024-02-02 02:59:50 +09:00
Rui Ueyama
ba67c5d977 Fix CI 2024-02-02 02:35:12 +09:00
Rui Ueyama
7f8d77d84e Do not optimize absolute symbols in DSOs 2024-02-02 01:28:09 +09:00
Rui Ueyama
91a88ee80f
Merge pull request #1186 from dancrossnyc/upstream
illumos: Treat absolute symbols specially
2024-02-02 01:25:18 +09:00
Rui Ueyama
206fe8527f Do not try to use /proc/self/exe on macOS
That path does not exist on macOS.

Fixes https://github.com/rui314/mold/issues/1185
2024-02-01 16:23:24 +01:00
Dan Cross
bed5b1731b illumos: Treat absolute symbols specially
illumos is a descendent of Solaris/OpenSolaris, and treats
symbols with shndx=SHN_ABS and st_value=0 specially, such that
they should be marked imported.  This change adds a special
case for this behavior, wrapped up in a function that #ifdef's
out on other platforms.  With this patch, executables linked
with mold on illumos run; without it, they do not.

The original behavior was spotted by Luqman Aden (@luqmana).
This also patches a small bogon in the third-party `mimalloc`
code.  I've sent that same fix upstream, but so far the
maintainer has not resonded, so replicate here.

Fixes #1183

Signed-off-by: Dan Cross <cross@oxidecomputer.com>
2024-02-01 13:55:05 +00:00
Rui Ueyama
c36b83fdea
Merge pull request #1177 from ishitatsuyuki/icf-workaround
Ignore addrsig sections corrupted by strip
2024-01-20 20:59:56 +09:00
Tatsuyuki Ishi
fede4a8102 Ignore addrsig sections corrupted by strip
When removing symbols, the indices in .llvm_addrsig also needs to be
updated, but binutils is not aware of this and leaves the table in a
corrupt state.

Use the same test as what LLD uses to reject potentially corrupted addrsig
sections.

Unfortunately, testing this seems tricky. While producing a file with OOB
addrsig index is not hard, it's hard to consistently trigger a segfault
with that access.

Signed-off-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
2024-01-20 17:28:51 +09:00
Rui Ueyama
29c0baa151
Merge pull request #1175 from filipnavara/aadwarf 2024-01-19 18:57:18 +09:00
Rui Ueyama
5d04d9c6cd
Merge pull request #1176 from sicherha/fix_unit_tests_on_s390x 2024-01-19 17:58:52 +09:00
Christoph Erhardt
2415b3e0bb [ELF][S390X] Skip tests that still fail with GCC 14
Signed-off-by: Christoph Erhardt <github@sicherha.de>
2024-01-18 21:53:12 +01:00
Filip Navara
d832547ba2 Add support for .eh_frame section on arm32 2024-01-18 18:28:26 +01:00
Rui Ueyama
fe118f6347 Fix CI 2023-12-24 14:42:01 +09:00
Rui Ueyama
9554b92c86 Allow escaped meta-characters in version script patterns 2023-12-24 14:04:51 +09:00
Rui Ueyama
669ada024e Simplify 2023-12-24 13:53:02 +09:00