History log of /llvm-project/lld/ELF/MapFile.cpp (Results 1 – 25 of 122)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5
# 099a52fd 24-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Reorder SectionBase/InputSectionBase members

Move `sectionKind` outside the bitfield and move bss/keepUnique to
InputSectionBase.

* sizeof(InputSection) decreases from 160 to 152 on 64-bit sy

[ELF] Reorder SectionBase/InputSectionBase members

Move `sectionKind` outside the bitfield and move bss/keepUnique to
InputSectionBase.

* sizeof(InputSection) decreases from 160 to 152 on 64-bit systems.
* The numerous `sectionKind` accesses are faster.

show more ...


Revision tags: llvmorg-19.1.4
# 58a971f4 16-Nov-2024 Fangrui Song <i@maskray.me>

[ELF] Replace contex-less toString(x) with toStr(ctx, x)

so that we can remove the global `ctx` from toString implementations.
Rename lld::toString (to lld::elf::toStr) to simplify name lookup (we
h

[ELF] Replace contex-less toString(x) with toStr(ctx, x)

so that we can remove the global `ctx` from toString implementations.
Rename lld::toString (to lld::elf::toStr) to simplify name lookup (we
have many llvm::toString and another lld::toString(const llvm::opt::Arg
&)).

show more ...


# 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
# e6625a2c 20-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx &


# 861bd36b 20-Oct-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to Symbol::getVA


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

[ELF] Pass Ctx &


Revision tags: llvmorg-19.1.1
# 17473182 29-Sep-2024 Fangrui Song <i@maskray.me>

[ELF] Pass Ctx & to MapFile


# 6f482010 22-Sep-2024 Fangrui Song <i@maskray.me>

[ELF] Replace config-> with ctx.arg.


Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4
# 4629aa17 22-Aug-2024 Fangrui Song <i@maskray.me>

[ELF] Move script into Ctx. NFC

Ctx was introduced in March 2022 as a more suitable place for such
singletons.

We now use default-initialization for `LinkerScript` and should pay
attention to non-c

[ELF] Move script into Ctx. NFC

Ctx was introduced in March 2022 as a more suitable place for such
singletons.

We now use default-initialization for `LinkerScript` and should pay
attention to non-class types (e.g. `dot` is initialized by commit
503907dc505db1e439e7061113bf84dd105f2e35).

show more ...


Revision tags: llvmorg-19.1.0-rc3
# 7e8a9020 05-Aug-2024 Daniel Thornburgh <dthorn@google.com>

[LLD] Add CLASS syntax to SECTIONS (#95323)

This allows the input section matching algorithm to be separated from
output section descriptions. This allows a group of sections to be
assigned to mul

[LLD] Add CLASS syntax to SECTIONS (#95323)

This allows the input section matching algorithm to be separated from
output section descriptions. This allows a group of sections to be
assigned to multiple output sections, providing an explicit version of
--enable-non-contiguous-regions's spilling that doesn't require altering
global linker script matching behavior with a flag. It also makes the
linker script language more expressive even if spilling is not intended,
since input section matching can be done in a different order than
sections are placed in an output section.

The implementation reuses the backend mechanism provided by
--enable-non-contiguous-regions, so it has roughly similar semantics and
limitations. In particular, sections cannot be spilled into or out of
INSERT, OVERWRITE_SECTIONS, or /DISCARD/. The former two aren't
intrinsic, so it may be possible to relax those restrictions later.

show more ...


Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1
# af263ceb 25-Jan-2024 Alexandre Ganea <alex_toresh@yahoo.fr>

[LLD][ELF] Silence warning when building with Clang ToT

This fixes:
```
[5839/7452] Building CXX object tools\lld\ELF\CMakeFiles\lldELF.dir\MapFile.cpp.obj
C:\git\llvm-project\lld\ELF\MapFile.cpp(12

[LLD][ELF] Silence warning when building with Clang ToT

This fixes:
```
[5839/7452] Building CXX object tools\lld\ELF\CMakeFiles\lldELF.dir\MapFile.cpp.obj
C:\git\llvm-project\lld\ELF\MapFile.cpp(124,38): warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'const ssize_t' (aka 'const int') [-Wsign-compare]
124 | last.outputOff + last.size == p.outputOff) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
1 warning generated.
```

show more ...


Revision tags: llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4
# 1981b1b6 17-Oct-2023 Fangrui Song <i@maskray.me>

[ELF] Demote symbols in /DISCARD/ discarded sections to Undefined (#69295)

When an input section is matched by /DISCARD/ in a linker script, GNU ld
reports errors for relocations referencing symbols

[ELF] Demote symbols in /DISCARD/ discarded sections to Undefined (#69295)

When an input section is matched by /DISCARD/ in a linker script, GNU ld
reports errors for relocations referencing symbols defined in the section:

`.aaa' referenced in section `.bbb' of a.o: defined in discarded section `.aaa' of a.o

Implement the error by demoting eligible symbols to `Undefined` and changing
STB_WEAK to STB_GLOBAL. As a side benefit, in relocatable links, relocations
referencing symbols defined relative to /DISCARD/ discarded sections no longer
set symbol/type to zeros.

It's arguable whether a weak reference to a discarded symbol should lead to
errors. GNU ld reports an error and our demoting approach reports an error as
well.

Close #58891

Co-authored-by: Bevin Hansson <bevin.hansson@ericsson.com>

show more ...


Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 67a212af 11-Jul-2023 Alex Brachet <abrachet@google.com>

[ELF] Make subsequent opens to auxiliary files append

Previously, the same file could be used across diagnostic options but
the file would be silently overwritten by the whichever option gets
handle

[ELF] Make subsequent opens to auxiliary files append

Previously, the same file could be used across diagnostic options but
the file would be silently overwritten by the whichever option gets
handled last.

Differential Revision: https://reviews.llvm.org/D153873

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1
# 3df4c5a9 27-Jan-2023 Jez Ng <jezng@fb.com>

[NFC] Optimize vector usage in lld

By using emplace_back, as well as converting some loops to for-each, we can do more efficient vectorization.

Make copy constructor for TemporaryFile noexcept.

Re

[NFC] Optimize vector usage in lld

By using emplace_back, as well as converting some loops to for-each, we can do more efficient vectorization.

Make copy constructor for TemporaryFile noexcept.

Reviewed By: #lld-macho, int3

Differential Revision: https://reviews.llvm.org/D139552

show more ...


Revision tags: llvmorg-17-init, llvmorg-15.0.7
# 08e2a763 01-Dec-2022 Guillaume Chatelet <gchatelet@google.com>

[lld][NFC] rename ELF alignment into addralign


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2
# 34fa8600 01-Oct-2022 Fangrui Song <i@maskray.me>

[ELF] Remove ctx indirection. NFC

Add LLVM_LIBRARY_VISIBILITY to remove unneeded GOT and unique_ptr
indirection. We can move other global variables into ctx without
indirection concern. In the long

[ELF] Remove ctx indirection. NFC

Add LLVM_LIBRARY_VISIBILITY to remove unneeded GOT and unique_ptr
indirection. We can move other global variables into ctx without
indirection concern. In the long term we may consider passing Ctx
as a parameter to various functions and eliminate global state as
much as possible and then remove `Ctx::reset`.

show more ...


Revision tags: llvmorg-15.0.1
# bd16ffb3 09-Sep-2022 Fangrui Song <i@maskray.me>

[ELF] Merge Symbol::needs* into uint16_t flags. NFC

Split off from D133003 ([ELF] Parallelize relocation scanning) to make its diff smaller.


Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 9a572164 30-Jun-2022 Fangrui Song <i@maskray.me>

[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC


Revision tags: llvmorg-14.0.6
# 7effcbda 19-Jun-2022 Nico Weber <thakis@chromium.org>

Rename parallelForEachN to just parallelFor

Patch created by running:

rg -l parallelForEachN | xargs sed -i '' -c 's/parallelForEachN/parallelFor/'

No behavior change.

Differential Revision: ht

Rename parallelForEachN to just parallelFor

Patch created by running:

rg -l parallelForEachN | xargs sed -i '' -c 's/parallelForEachN/parallelFor/'

No behavior change.

Differential Revision: https://reviews.llvm.org/D128140

show more ...


Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3
# 6c814931 08-Mar-2022 Fangrui Song <i@maskray.me>

[ELF] Don't use multiple inheritance for OutputSection. NFC

Add an OutputDesc class inheriting from SectionCommand. An OutputDesc wraps an
OutputSection. This change allows InputSection::getParent t

[ELF] Don't use multiple inheritance for OutputSection. NFC

Add an OutputDesc class inheriting from SectionCommand. An OutputDesc wraps an
OutputSection. This change allows InputSection::getParent to be inlined.

Differential Revision: https://reviews.llvm.org/D120650

show more ...


Revision tags: llvmorg-14.0.0-rc2
# 7fd3849b 27-Feb-2022 Fangrui Song <i@maskray.me>

[ELF] Move --print-archive-stats= and --why-extract= beside --warn-backrefs report

So that early errors don't suppress their output.


# 3d854240 15-Feb-2022 Fangrui Song <i@maskray.me>

[ELF] Parse archives as --start-lib object files

https://maskray.me/blog/2022-01-16-archives-and-start-lib

For every definition in an extracted archive member, we intern the symbol twice,
once for

[ELF] Parse archives as --start-lib object files

https://maskray.me/blog/2022-01-16-archives-and-start-lib

For every definition in an extracted archive member, we intern the symbol twice,
once for the archive index entry, once for the .o symbol table after extraction.
This is inefficient.

Symbols in a --start-lib ObjFile/BitcodeFile are only interned once because the
result is cached in symbols[i].

Just handle an archive using the --start-lib code path. We can therefore remove
ArchiveFile and LazyArchive. For many projects, archive member extraction ratio
is high and it is a net performance win. Linking a Release build of clang is
1.01x as fast.

Note: --start-lib scans symbols in the same order that llvm-ar adds them to the
index, so in the common case the semantics should be identical. If the archive
symbol table was created in a different order, or is incomplete, this strategy
may have different semantics. Such cases are considered user error.

The `is neither ET_REL nor LLVM bitcode` error is changed to a warning.
Previously an archive may have such members without a diagnostic. Using a
warning prevents breakage.

* For some tests, the diagnostics get improved where we did not consider
the archive member name: `b.a:` => `b.a(b.o):`.
* `no-obj.s`: the link is now allowed, matching GNU ld
* `archive-no-index.s`: the `is neither ET_REL nor LLVM bitcode` diagnostic is
demoted to a warning.
* `incompatible.s`: even when an archive is unextracted, we may report an
"incompatible with" error.

---

I recently decreased sizeof(SymbolUnion) by 8 and decreased memory usage quite a
bit, so retaining `symbols` for un-extracted archive members should not cause a
memory usage problem.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D119074

show more ...


Revision tags: llvmorg-14.0.0-rc1
# 27bb7990 08-Feb-2022 Fangrui Song <i@maskray.me>

[ELF] Clean up headers. NFC


Revision tags: llvmorg-15-init
# 1372d536 27-Jan-2022 Fangrui Song <i@maskray.me>

[ELF] Optimize two vector. NFC


# afeb4a66 27-Jan-2022 Fangrui Song <i@maskray.me>

[ELF] Optimize -Map. NFC

getVA is slow. Avoid calling it in the llvm::sort comparator.


12345