| commit | 7b346357db30d531245104c1c0aa8940a1f41b9a | [log] [tgz] |
|---|---|---|
| author | Fangrui Song <i@maskray.me> | Tue Jun 04 09:14:54 2024 -0700 |
| committer | GitHub <noreply@github.com> | Tue Jun 04 09:14:54 2024 -0700 |
| tree | c0a59e54ae51f5e6d339e4df004ece4dff5d6063 | |
| parent | 6ac5047aa6bf12644e38afb188bd8d821a181ba5 [diff] |
[ELF] Orphan placement: prefer the last similar section when its rank <= orphan's rank `findOrphanPos` finds the most similar output section (that has input sections). In the event of proximity ties, we select the first section. However, when an orphan section's rank is equal to or larger than the most similar sections's, it makes sense to prioritize the last similar section. This new behavior matches GNU ld better. ``` // orphan placement for .bss (SHF_ALLOC|SHF_WRITE, SHT_NOBITS) WA SHT_PROGBITS (old behavior) <= here A WA SHT_PROGBITS AX WA (.data) (new behavior) <= here ``` When the orphan section's rank is less, the current behavior prioritizing the first section still makes sense. ``` // orphan with a smaller rank, e.g. .rodata <= here WA AX WA ``` Close #92987 Pull Request: https://github.com/llvm/llvm-project/pull/94099
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.