17887 Commits

Author SHA1 Message Date
Fatih BAKIR
c703f5a163
[lld][Webassembly] Avoid a signed overflow on large sections (#178287)
wasm sections sizes are specified as u32s, and thus can be as large as
4GB. wasm-ld currently stores the offset into a section as an int32_t
which overflows on large sections and results in a crash. This change
makes it a int64_t to accommodate any valid wasm section and allow
catching even larger sections instead of wrapping around.

This PR fixes the issue by storing the offset as a int64_t, as well as
adding extra checks to handle un-encodeable sections to fail instead of
producing garbage wasm binaries, and also adds lit tests to make sure it
works. I confirmed the test fails on `main` but passes with this fix.

Fixes: #178286
2026-02-10 12:04:05 -08:00
Sam Clegg
11c2613342
[WebAssembly] Add initial support for compact imports proposal (#176617)
This change adds initial support to libObject for reading compact
imports and support for writing compact imports in the linker.

There is minimal testing here since to tools like lllvm-readobj, and
obj2yaml don't currently report compact imports any differently.

See https://github.com/WebAssembly/compact-import-section
2026-02-10 10:57:45 -08:00
Petr Beneš
6558595ca3
[LLD][COFF] Fix out-of-bounds write when filling gaps with INT3 in code sections (#180411)
When merging `.bss` into a code section (e.g., `/MERGE:.bss=.text`), the
INT3 gap-filling loop in `writeSections()` would write past the output
buffer. This happens because `.bss` chunks have `hasData=false`, so they
contribute to `VirtualSize` but not `SizeOfRawData`. The loop was using
chunk RVAs without checking if they exceeded the raw data region.

This caused a crash on Windows with `/FILEALIGN:1` (access violation
0xC0000005). The tight alignment leaves no slack in the mapped buffer,
so the overflow immediately hits unmapped memory.

The fix bounds all memset operations to `rawSize` and exits early when
encountering chunks beyond the raw data boundary.

Fixes #180406
2026-02-10 13:26:03 +00:00
Sam Clegg
a9ea1cfe6e
[lld][WebAssembly] Add new __rodata_start/__rodata_end symbols (#172102)
This is similar to etext/_etext in the ELF linker. Its useful in
emscripten to know where the RO data data ends and the data begins (even
though the Wasm format itself has no concept of RO data).

See
https://github.com/emscripten-core/emscripten/discussions/25939#discussioncomment-15243731
2026-02-09 14:29:42 -08:00
Brian Cain
62d018b87a
[lld][Hexagon] Fix R_HEX_TPREL_11_X relocation on duplex instructions (#179860)
findMaskR11() was missing handling for duplex instructions. This caused
incorrect encoding when R_HEX_TPREL_11_X relocations were applied to
duplex instructions with large TLS offsets.

For duplex instructions, the immediate bits are located at positions
20-25 (mask 0x03f00000), not in the standard positions used for
non-duplex instructions.

This fix adds the isDuplex() check to findMaskR11() to return the
correct mask for duplex instruction encodings.
2026-02-09 14:45:36 -06:00
Jessica Clarke
20d3aa944f
[NFC][ELF] Remove redundant and unused file argument from deleteFallThruJmpInsn (#180540)
This was added in 94317878d826 ("LLD Support for Basic Block Sections")
and was only ever used for getRelocTargetVA. It was always redundant
even back then, as it was always the same as is.file, and so passing it
separately made it confusing and less obvious which file it was
referring to, but 2b5cb1bf628f ("[ELF] getRelocTargetVA: pass Ctx and
Relocation. NFC") removed that one use so it is now completely unused.
Remove it, and if anyone ever finds a need for it, they can just use
is.file like should have been done in the first place.
2026-02-09 18:57:42 +00:00
Jessica Clarke
fbcfbd9d3a [NFC][ELF] Fix overzealous find/replace affecting comments
Commit a94060ca0c87 ("[ELF] Pass Ctx & to Relocations") swapped the
InputSectionBase &c argument for an InputSectionBase *sec member, and so
"c." was replaced with "sec->". However, this must have done in such a
way that "Local-Exec." was transformed to "Local-Exesec->" and
"RISCV::relocateAlloc." to "RISCV::relocateAllosec->", i.e. without the
use of something like clangd, and without appropriate word boundaries in
a regex.
2026-02-09 14:35:50 +00:00
serge-sans-paille
0cd8fd974d
[lld] Add explicit std::move(...) to avoid a few vector copies (#180474)
In corner cases, it is profitable to move an llvm::SmallString instead
of copying it.

It is almost always profitable to move an std::vector

Changes suggested by performance-use-std-move from
https://github.com/llvm/llvm-project/pull/179467
2026-02-09 11:59:04 +00:00
Aiden Grossman
be4dbf5d64
[lld][ELF] Remove redundant size check in nopInstrFill
We checked twice of size is equal to zero. This is not necessary and
makes the code a little bit less readable.

Reviewers: MaskRay, tmsri

Pull Request: https://github.com/llvm/llvm-project/pull/180304
2026-02-07 09:30:20 -08:00
Sam Clegg
5f644d966e
[lld][WebAssembly] Improve import mismatch error reporting (#178715)
Followup to #178550
2026-02-06 13:09:02 -08:00
Ellis Hoag
9f4e8bca03
[lld][BP] Fix nondeterministic function order by using MapVector (#179841)
There are two places where the nondeterministic iteration order of
`DenseMap` (the original type of `startupSectionIdxUNs`) causes the
output function order to be nondeterministic.


16e2e7f591/lld/include/lld/Common/BPSectionOrdererBase.inc (L240-L245)


16e2e7f591/lld/include/lld/Common/BPSectionOrdererBase.inc (L267-L268)

The fix is to use `MapVector` whose iteration order is guaranteed to be
deterministic.

To test, I built a large binary several times and observed this value no
longer changes.

16e2e7f591/lld/include/lld/Common/BPSectionOrdererBase.inc (L410-L411)

It seems that this regresses linktime by a few seconds, but I believe
the tradeoff is worthwhile.
2026-02-06 09:49:37 -08:00
Fangrui Song
0d52536b04 [ELF][test] Consolidate .eh_frame FDE encoding tests
Merge eh-frame-value-format{1..9}.s into eh-frame-fde-encoding.s
(encoding is the DWARF term) using split-file. Add .eh_frame and
.eh_frame_hdr content verification for absptr, udata2, sdata4, udata4.
Move error test (9) to eh-frame-invalid-fde-encoding.s.
2026-02-05 23:41:45 -08:00
Fangrui Song
2d8ce3a313 [ELF][test] Consolidate invalid-eh-frame tests
Merge 9 individual invalid-eh-frame test files into 2 categorized files
using split-file:

- eh-frame-invalid-cie.s: CIE structure errors (too small, unexpected
  end, failed string/LEB128 reads)
- eh-frame-invalid-fde-encoding.s: EhReader::getFdeEncoding errors
  (unknown augmentation string, unknown FDE encoding, unsupported
  aligned encoding, corrupted CIE)
2026-02-05 21:30:45 -08:00
Fangrui Song
adf7dbc2a8 [ELF,test] Improve error message tests
They have multiple `not ld.lld` commands or they test multiple error
messages. Add --implicit-check-not=error: to catch unexpected errors.
While updating them, use directory isolation pattern and simplify
filenames where appropriate.

Rename abs-conflict.s to conflict-abs.s to be consistent with other
conflict*.s tests.
2026-02-04 20:29:54 -08:00
Fangrui Song
d53bf41395
[ELF] Support DW_EH_PE_sdata8 encoding in .eh_frame_hdr (#179089)
Currently, both GNU ld and lld only support
`table_enc = DW_EH_PE_datarel | DW_EH_PE_sdata4` for .eh_frame_hdr.
When a table entry exceeds the 32-bit range, we can use
`DW_EH_PE_sdata8` instead of reporting an error
(https://reviews.llvm.org/D49607 introduced the "PC offset is too large"
error). This is useful for certain large executables.

This patch auto-detects when 64-bit encoding is needed and upgrades
the encoding accordingly. We use DW_EH_PE_sdata8 when either a table
entry or eh_frame_ptr exceeds the 32-bit range.

Technically, eh_frame_ptr could remain sdata4 when only table entries
require sdata8, but there is little value in this flexibility since
.eh_frame/.eh_frame_hdr distance is a much less strict constraint than
.text/.eh_frame_hdr distance.

The implementation caches FDE data in EhFrameHeader during
updateAllocSize and reuses it in writeTo.

Previously, `EhFrameSection::getFdePc` was used to read the
`initial_location` value from .eh_frame FDEs. Since the value equals the
relocated symbol's VA for all cases that matter, we now obtain the value
directly and simplify the implementation.

Also update the outdated comment about sorting the FDE list; the ICF
case mentioned there no longer applies after
https://reviews.llvm.org/D116093.

In the new test eh-frame-hdr-sdata8.s, 3.lds is carefully crafted to
ensure that .eh_frame_hdr size requires fixed-point iteration (to test
`updateAllocSize`). This is also groundwork for compact unwind support
similar to Mach-O `__unwind_info`.

Close #172777
2026-02-03 19:58:52 -08:00
alx32
2a2dd17b3a
[lld-macho] Fix branch relocations with addends to target actual function (#177430)
When a branch relocation has a non-zero addend (e.g., `bl _func+16`),
the linker was incorrectly computing `stub_address + addend` instead of
`function_address + addend`. This caused the branch to land in the wrong
location (past the stub section) rather than at the intended interior
point of the function.

The fix checks for non-zero addends on branch relocations and uses the
actual symbol VA in those cases. This makes sense semantically—branching
to an interior offset implies reliance on the original function's
layout, which an interposed replacement wouldn't preserve anyway.

Added test `arm64-branch-addend-stubs.s` that verifies the correct
behavior using `-flat_namespace` (which makes local symbols interposable
and thus routed through stubs).

[Assisted-by](https://t.ly/Dkjjk): Cursor IDE + claude-opus-4.5-high
2026-02-02 13:14:07 -08:00
Fangrui Song
6a18039298 [ELF,test] Improve riscv and aarch64 relocation error tests
Adopt modern test patterns for relocation overflow and alignment error
tests:

* Use `rm -rf %t && mkdir %t && cd %t` pattern for isolation. Use simple
  filenames (32.o, 64.o, out.32) instead of %t-prefixed names
* Use `--defsym` instead of external input files where possible
* Omit `-o /dev/null` for negative tests (implicit when errors occur)
* Add `--implicit-check-not=error:` to catch unexpected errors
2026-02-01 14:56:19 -08:00
Fangrui Song
2f09bd2fc2 [ELF,test] Improve error/warning message checks
Update tests to include proper `error:` or `warning:` prefixes and
file/section information in CHECK patterns. Add
--implicit-check-not=error: to ensure no unexpected errors are produced.
2026-02-01 11:25:22 -08:00
Fangrui Song
9065730178 [ELF,test] Improve error message checks with proper format
Update tests to use the canonical error message format with `error:`
prefix and file:section information. Add `--implicit-check-not=error:`
to ensure no unexpected errors are produced.

This commit focuses on "out of range" and "not aligned" errors.
2026-02-01 10:27:59 -08:00
Fangrui Song
bc45ea2c4f
[ELF] Fix IRELATIVE addend if the resolver address is updated by linker relaxation (#179063)
For a non-preemptible ifunc, `handleNonPreemptibleIfunc` creates a
cloned
symbol (`directSym`) to compute the addend of the IRELATIVE dynamic
relocation.
This cloned symbol wasn't tracked by `initSymbolAnchors`, so its value
wasn't adjusted during RISC-V/LoongArch linker relaxation.
This caused IRELATIVE addends to point to pre-relaxation addresses.

Fix this by:

- Tracking cloned IRELATIVE symbols in `ctx.irelativeSyms`
- Adding these symbols to `relaxAux->anchors` in `initSymbolAnchors`
2026-01-31 21:51:03 +00:00
Jessica Clarke
85236008ea
[NFCI][ELF][AArch64][PAC] Teach addRelativeReloc to emit R_AARCH64_AUTH_RELATIVE
This allows R_AARCH64_AUTH_ABS64 to follow R_AARCH64_ABS64's flow rather
than being implemented on the side in the place that is normally for
symbolic relocations.

Note that this has one implementation change: the RelExpr passed to
relaDyn is now RE_AARCH64_AUTH rather than R_ABS, but the two are
handled identically by InputSectionbase::getRelocTargetVA, and it was
inconsistent with relrAuthDyn which was passed RE_AARCH64_AUTH.

Reviewers: kovdan01

Pull Request: https://github.com/llvm/llvm-project/pull/171180
2026-01-31 18:09:27 +00:00
Jessica Clarke
859d3b8e9c
[ELF][AArch64][PAC][MTE] Handle Memtag globals for R_AARCH64_AUTH_ABS64
Currently, R_AARCH64_AUTH_ABS64 against a tagged global just ignores the
tagging and so, if out of the symbol's bounds, does not write the
negated original addend for the loader to determine which granule's tag
to use for it. Handle the composition of the two.

Note that R_AARCH64_AUTH_ABS64/RELATIVE encode the signing schema in the
upper 32 bits of the value at the relocation target, and so only the
lower 32 bits are available for use as an addend, including for Memtag's
disambiguation, and so if a wildly out-of-bounds PAuth relocation
against a tagged global is used we have no choice but to error out with
the current ABI.

Reviewers: MaskRay, kovdan01, smithp35, asl

Reviewed By: smithp35

Pull Request: https://github.com/llvm/llvm-project/pull/173291
2026-01-31 18:06:31 +00:00
SharonXSharon
96b46fae9a
[lld][MachO] Accept hex format for cstring hashes in order file (#178933)
Support both decimal and hexadecimal formats for cstring hashes in
the order file. Hex values must use the 0x prefix (case insensitive).
    
    Examples:
      CSTR;1234567890    (decimal)
      CSTR;0x499602D2    (hex)

Co-authored-by: Sharon Xu <sharonxu@fb.com>
2026-01-30 14:27:13 -08:00
Fangrui Song
55e1d3ab7e [ELF] Rename isAbsoluteValue for clarity. NFC
and fix a stale comment.
2026-01-29 23:42:42 -08:00
Fangrui Song
6bba170a26 [ELF] Remove unneeded -z ifunc-noplt check. NFC
The `isIfunc && zIfuncNoplt` code path does not use the RelExpr, so we
don't need to adjust it.
2026-01-29 20:35:15 -08:00
Sam Clegg
48c6c7f43f
[lld][WebAssembly] Fix symbol type for __memory_base/__table_base. (#178773)
When linking PIC code as non-PIC we internally define `__memory_base`
and `__table_base`. However we were defining these incorrectly as data
symbols and not global symbols (as in Wasm globals).

This happened to work incidentally as long as there was a live reference
to the symbol. This is because the live reference would cause a GOT
entry to be created for these symbol and then they could be referenced
via via `R_WASM_GLOBAL_INDEX_LEB` or `R_WASM_GLOBAL_INDEX_I32`. However,
when no live reference existed there could still be references from
debug sections, and in that case the relocation code was crashing.

Fixes: #174676
2026-01-29 16:47:03 -08:00
Sam Clegg
d0a8834e85
[lld][WebAssembly] Honor export flags in addOptionalGlobalSymbol. NFC (#178754)
This change updates addOptionalGlobalSymbol to match
addOptionalDataSymbol.

The effected tests here are all using the `--export-all` flag.
2026-01-29 13:57:40 -08:00
Sam Clegg
22c4f9534a
[lld][WebAssembly] Improve merging multiple occurrences of an undefined symbol (#178550)
This change renames `setImportAttributes` to `updateExistingUndefined`
which better defines what it does. We also now call this function for
all different symbol types.

In addition we preserve the `NO_STRIP` symbol attribute if any undefined
reference is tagged as such.

This is partial fix for #174676, although there seems to be anther crash
that occurs after this issue is fixed.
2026-01-29 09:27:22 -08:00
Fangrui Song
7dfa132936
[ELF,RISCV] Fix code style after #169273 (#178365) 2026-01-28 20:13:17 -08:00
Jessica Clarke
9fb61d9722
[NFCI][ELF][Mips] Refactor MipsGotSection to avoid explicit writes (#178561)
Splitting the VA / addend calculations between build and writeTo means
having to keep them in sync and duplicating some of the logic. Move all
such calculations into build, mirroring how the normal non-MIPS code in
Relocations.cpp ensures the addend and initial memory contents are set.
2026-01-29 02:03:27 +00:00
Zachary Yedidia
fcd609762c
[lld] Fill section gaps with trap instructions (#176845)
Fills unused parts of code segments with trap instructions instead of
zeroes. This is especially useful on x86-64 since 0x00 0x00 is a
two-byte instruction that performs a memory access. Benefits:

- Provides an explicit trap when executing invalid code.
- Required for security reasons when targeting LFI.
- Makes disassembling easier, especially without symbol information.
Previously an odd number of zero bytes between sections could cause a
disassembler to incorrectly disassemble the remainder of the program.
2026-01-28 15:32:29 -08:00
Sam Clegg
5ad8266718
[lld][WebAssembly] Convert pic-static test to assembly. NFC (#178321)
The expectations and the `RUN` commands here are otherwise unmodified.
2026-01-28 09:56:45 -08:00
Rose Hudson
e45ea95dbe
[DTLTO] support distributing bitcode from FatLTO objects (#176928)
We already have code to extract bitcode files from archives so they can
be distributed. Extend this code to extract bitcode from FatLTO objects
too, which otherwise cannot be used with DTLTO.
2026-01-28 17:45:58 +00:00
Fangrui Song
5e3b7084dc
[ELF] Simplify RelocScan after #163138 (#178375) 2026-01-28 08:22:46 +00:00
Ben Dunbobbin
1d74db7e8d
[DTLTO] Make temporary file handling consistent (#176807)
DTLTO emits temporary files to allow distribution of archive member
inputs.

It also emits temporary files from the ThinLTO backend, such as the
index files needed for each distributed ThinLTO backend compilation.

This change brings archive member temporary files into line with those
produced by the ThinLTO backend. They are now emitted in the same
location, warnings are emitted if they cannot be deleted, and they are
cleaned up on abnormal exit (e.g. Ctrl-C). All temporary files are
preserved when --save-temps is specified.

The existing signal-handling test has been extended to cover the full
set of DTLTO temporary files, and a new test has been added to exercise
temporary file handling in normal operation. Additionally, a minimal
test has been added to show the COFF behaviour.

SIE Internal tracker: TOOLCHAIN-21022
2026-01-26 17:55:49 +00:00
Fangrui Song
e34651fa55
[ELF] Set vna_flags to VER_FLG_WEAK if all references are weak (#176673)
When all undefined references to a version are weak, set vna_flags to
VER_FLG_WEAK in the .gnu.version_r section. This enables glibc ld.so to
report a warning instead of an error when the required version is not
found at runtime, supporting optional dependencies.

Per https://sourceware.org/bugzilla/show_bug.cgi?id=24718#c20 ,
glibc rtld since 2.30 (BZ #24741) tolerates missing versioned symbols
when the runtime shared object defines the required version. With this
vna_flags VER_FLG_WEAK change, rtld can also tolerate a completely
missing version, printing a message like:

```
% LD_PRELOAD=c2.so ./a
./a: /tmp/t/v2/c2.so: weak version `v1' not found (required by /tmp/t/v2/b.so)
a
```

instead of a fatal error.

In addition, add a comment about `vn.vernaxus.size() == 1`.
2026-01-23 20:43:52 -08:00
Sam Clegg
4c5ffe74e8
[lld][ELF/MachO] Use .contains rather than .count for set membership. NFC (#177404)
This matches the usage in the other linker backends.

See #176610, #177067
2026-01-22 10:08:22 -08:00
Fangrui Song
1869b15a05
[ELF] --why-live: Skip symbol at index 0 and section symbols, handle .eh_frame symbols (#177099)
Symbols of empty names can be matched by `--why-live='*'`, which are
generally not useful.

* The first entry in a symbol table (STB_LOCAL and undefined)
* `STT_SECTION` symbols (emitted by LLVM integrated assembler when
  needed by relocations). These input section symbols will be demoted by
  `demoteAndCopyLocalSymbols`, so technically not really live.
  In addition, such symbols of non-allocable sections currently lead to
  crashes: `whyLive` does not record the section, causing the second
  iteration of the `while (true)` loop in printWhyLive to call
  `std::get<Symbol *>(cur)` when `cur` is an `InputSectionBase *`.

In addition, handle GCC crtendS.o `__FRAME_END__`, which is defined
relative to a `.eh_frame` section created with
`__attribute__((used, section(".eh_frame")))`.

Fix #176890
2026-01-22 02:58:35 +00:00
Sam Clegg
53c237c006
[lld][COFF] Use .contains rather than .count for set membership. NFC (#177067)
Also converted a couple of `std::set` to
`llvm::StringSet`/`llvm::SmallSet`.

This matches the usage in the other linker backends.

See #176610
2026-01-21 17:12:27 -08:00
Daniel Thornburgh
567fe2bbca
[NFC][LTO] Move isPreservedName out of IRSymtab into LTO's Symbol as isLibcall (#177046)
This resolves the FIXME in IRSymtab and cleans up the semantics of the
IRSymtab. The list of preserved symbols really shouldn't be seen as a
property of the IR symbol table, since it's an LTO-specific concern, and
it's very tenuous to claim that this information is actually present in
the bitcode file to be exposed through its symbol table.

Instead, this PR moves this logic into LTO's view of the symbol, which
allows consumers to determine preserved-ness themselves. This was broken
out of #164916; this prevents that PR from introducing a circular
dependency, but it still seems like an independently good idea by virtue
of the above.
2026-01-21 11:32:33 -08:00
Sam Clegg
1d050b0ede
[lld][WebAssembly] Use .contains rather than .count for testing set membership. NFC (#176610) 2026-01-20 16:13:47 -08:00
Ben Dunbobbin
31f5be4ce5
[DTLTO] Add DTLTO-specific LTO input handling time-trace scopes (#175799)
Add time-trace scopes to the DTLTO-specific input-handling code to
improve observability and debugging.

These scopes are tested via LLD, as the primary purpose of this code is
to support member files of non-thin archives as DTLTO inputs.
`llvm-lto2` does not currently support archives. Adding archive support
to `llvm-lto2` solely for testing these scopes does not appear to be
worthwhile.

As part of this change, the deletion of temporary DTLTO input files has
been moved. Cleanup now occurs after LTO has completed, rather than
during destruction of the LTO object. This is required since by the time
the LTO object is destroyed, time-traces have already been finalized, so
no additional trace data can be recorded.

Recording time-trace data for temporary file deletion is important, as
this has been a source of performance issues in the past and an area
where we expect to make further performance improvements if supported by
the data.

SIE internal tracker: TOOLCHAIN-21021
2026-01-19 14:06:58 +00:00
Sam Clegg
2282f60e69
[lld][WebAssembly] Fix crash in debug info relocation against shared symbols (#176460)
When a weakly defined function is not include because its defined in
shared object we should use the tombstone value during relocation of
debug info.

Fixes: https://github.com/emscripten-core/emscripten/issues/26044
2026-01-16 13:12:49 -08:00
Jessica Clarke
9b409e3651
[ELF][Mips] Fix addend for preemptible static TLS
If the symbol is preemptible the addend should be 0, not our
definition's VA. Note that by using addAddendOnlyRelocIfNonPreemptible
the generic Elf_Rel code will ensure the VA is written out as the addend
if the symbol is non-preemptible, and so writeTo only needs to write out
the VA in the case that we don't call it (so long as we make sure to
call relocateAlloc to actually apply any such relocations).

Reviewers: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/150729
2026-01-16 18:50:43 +00:00
Alex Bradbury
e9952a6993
[lld][COFF][NFC] Fix warnings on 32-bit asserts builds (#176178)
Fixes #130934 (Wsign-compare warnings reported for Wasm Emscripten
builds). I ran into this when building for 32-bit RISC-V.
2026-01-16 11:55:40 +00:00
hev
3af2e51eb9
[lld][ELF] Deduplicate PC-relative indirect relocation logic for RISC-V and LoongArch (#176312) 2026-01-16 17:35:27 +08:00
hev
fe8447d007
[lld][LoongArch] Clean up CALL30 relocation with setK16 and checkInt (#176311) 2026-01-16 17:35:05 +08:00
hev
019bf03697
[lld][LoongArch] Support reloc types for LA32R/LA32S (#172618)
This patch adds support for processing the relocation types introduced
in la-abi-specs v2.50.

Link: https://github.com/loongson/la-abi-specs/pull/16
Link:
https://sourceware.org/pipermail/binutils/2025-December/146091.html
2026-01-15 19:54:52 +08:00
Cullen Rhodes
752d7f590e Clear release notes 2026-01-13 09:34:22 +00:00
Alexis Engelke
af98aadc63
[LLD][MachO][NFC] Rename Reloc to Relocation (#175586)
Due to heavy use of using namespace llvm, Reloc is often ambiguous with
llvm::Reloc, the relocation model. Previously, this was sometimes
disambiguated with macho::Reloc. This ambiguity is even more problematic
when using pre-compiled headers, where it's no longer "obvious" whether
it should be Reloc or macho::Reloc.

Therefore, rename Reloc to Relocation. This is also consistent with
lld/ELF, where the type is also named Relocation.
2026-01-13 07:32:36 +01:00