History log of /llvm-project/lld/ELF/LinkerScript.cpp (Results 1 – 25 of 980)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 18078605 11-Jan-2025 amosher-nvidia <amosher@nvidia.com>

[lld][ELF] Handle archive special casing in Input Sections (#119293)

According to the binutils spec:
https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html

You should be able to speci

[lld][ELF] Handle archive special casing in Input Sections (#119293)

According to the binutils spec:
https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html

You should be able to specify all files in an archive using this syntax
`archivename:` , however, lld currently will only accept `archivename:*`
to match all files within an archive.

This patch will, only when necessary, create a copy of the file
specification and add an implicit wildcard `*` to the end. It also
updates the filename-spec linkerscript test to check for this behavior.

---------

Co-authored-by: Peter Smith <peter.smith@arm.com>

show more ...


Revision tags: llvmorg-19.1.6
# e83afbe7 17-Dec-2024 Fangrui Song <i@maskray.me>

[ELF] Remove unneeded sec->file check


Revision tags: llvmorg-19.1.5
# 1cd62756 24-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Remove unneeded Twine in ELFSyncStream


# e4e52060 24-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Make OutputDesc unique_ptr

Store them in LinkerScript::descPool. This removes a SpecificAlloc
instantiation, makes lld smaller, and drops the small memory waste due
to the separate BumpPtrAllo

[ELF] Make OutputDesc unique_ptr

Store them in LinkerScript::descPool. This removes a SpecificAlloc
instantiation, makes lld smaller, and drops the small memory waste due
to the separate BumpPtrAllocator.

show more ...


# a5203244 20-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Avoid make<PhdrEntry>

Store them in Partition::phdrs instead.


Revision tags: llvmorg-19.1.4
# 5b1b6a62 17-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Make elfHeader/programHeaders unique_ptr

This removes some SpecificAlloc instantiations, makes lld smaller, and
drops the small memory waste due to the separate BumpPtrAllocator.


# 2991a4e2 17-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Replace functions bAlloc/saver/uniqueSaver with member access


# a626eb2a 16-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Pass ctx to bAlloc/saver/uniqueSaver


# 3d57c797 15-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Migrate away from global ctx


# c13258ac 07-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Replace log with Log(ctx)


# 9b058bb4 07-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Replace errorOrWarn(...) with Err


# f8bae3af 07-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Replace warn(...) with Warn


# 09c2c5e1 07-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Replace error(...) with ErrAlways or Err

Most are migrated to ErrAlways mechanically.
In the future we should change most to Err.


Revision tags: llvmorg-19.1.3
# fe8af49a 20-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to Defined & CommonSymbol


# a2359a86 15-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Fix PROVIDE_HIDDEN -shared regression with bitcode file references

The inaccurate #111945 condition fixes a PROVIDE regression (#111478)
but introduces another regression: in a DSO link, if a

[ELF] Fix PROVIDE_HIDDEN -shared regression with bitcode file references

The inaccurate #111945 condition fixes a PROVIDE regression (#111478)
but introduces another regression: in a DSO link, if a symbol referenced
only by bitcode files is defined as PROVIDE_HIDDEN, lld would not set
the visibility correctly, leading to an assertion failure in
DynamicReloc::getSymIndex (https://reviews.llvm.org/D123985).
This is because `(sym->isUsedInRegularObj || sym->exportDynamic)` is
initially false (bitcode undef does not set `isUsedInRegularObj`) then
true (in `addSymbol`, after LTO compilation).

Fix this by making the condition accurate: use a map to track defined
symbols.

Reviewers: smithp35

Reviewed By: smithp35

Pull Request: https://github.com/llvm/llvm-project/pull/112386

show more ...


Revision tags: llvmorg-19.1.2
# a3bad9ad 12-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx &


# 9bf2e20b 12-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to OutputSection


# 6dd773b6 12-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx &


# 1c6688ae 11-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Make shouldAddProvideSym return values consistent when demoted to Undefined

Case: `PROVIDE(f1 = bar);` when both `f1` and `bar` are in separate
sections that would be discarded by GC.

Due to

[ELF] Make shouldAddProvideSym return values consistent when demoted to Undefined

Case: `PROVIDE(f1 = bar);` when both `f1` and `bar` are in separate
sections that would be discarded by GC.

Due to `demoteDefined`, `shouldAddProvideSym(f1)` may initially return
false (when Defined) and then return true (been demoted to Undefined).

```
addScriptReferencedSymbolsToSymTable
shouldAddProvideSym(f1): false
// the RHS (bar) is not added to `referencedSymbols` and may be GCed
declareSymbols
shouldAddProvideSym(f1): false
markLive
demoteSymbolsAndComputeIsPreemptible
// demoted f1 to Undefined
processSymbolAssignments
addSymbol
shouldAddProvideSym(f1): true
```

The inconsistency can cause `cmd->expression()` in `addSymbol` to be
evaluated, leading to `symbol not found: bar` errors (since `bar` in the
RHS is not in `referencedSymbols` and is GCed) (#111478).

Fix this by adding a `sym->isUsedInRegularObj` condition, making
`shouldAddProvideSym(f1)` values consistent. In addition, we need a
`sym->exportDynamic` condition to keep provide-shared.s working.

Fixes: ebb326a51fec37b5a47e5702e8ea157cd4f835cd

Pull Request: https://github.com/llvm/llvm-project/pull/111945

show more ...


# 81bd712f 11-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Revert Ctx & parameters from SyntheticSection

Since Ctx &ctx is a member variable,
1f391a75af8685e6bba89421443d72ac6a186599
7a5b9ef54eb96abd8415fd893576c42e51fd95db
e2f0ec3a3a8a2981be8a1aac200

[ELF] Revert Ctx & parameters from SyntheticSection

Since Ctx &ctx is a member variable,
1f391a75af8685e6bba89421443d72ac6a186599
7a5b9ef54eb96abd8415fd893576c42e51fd95db
e2f0ec3a3a8a2981be8a1aac2004cfb9064c61e8 can be reverted.

show more ...


# bf81bd80 11-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx &


# cfd3289a 07-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to some free functions


# b672071b 07-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to InputFile


# 5f634619 07-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to SyntheticSections


# 35900689 04-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to OutputSections


12345678910>>...40