| commit | 507f394d03d8cb24c90ae4b2d28e8afae3b4088d | [log] [tgz] |
|---|---|---|
| author | mykouHW <koumeiyuan@huawei.com> | Sun Sep 21 00:41:54 2025 +0800 |
| committer | GitHub <noreply@github.com> | Sat Sep 20 16:41:54 2025 +0000 |
| tree | d404d86ea2ed6beb2ec915fd11ad358a7d5cc6e4 | |
| parent | ef840d8fb7d072344867b21d2cb6574ba494b0c9 [diff] |
[ELF] -r/--emit-relocs: Fix crash when processing .rela.text before .text (#156354) fixes #156417 When the relocation section is placed before the relocated section and the relocated section is not defined in the linker script, an error will occur during the linking process. **Issue Cause:** In a.ro, `.rela.text` precedes its relocated `InputSection` `.text`. `addOrphanSections` doesn't handle this scenario. When it processes `.rela.text`, in the called `getOutputSectionName`, `rel->getOutputSection()` is nullptr (input `.text` doesn't yet have a parent output section), leading to an assertion failure. **Solution:** For --emit-relocs and -r, ensure the output section for `.text.foo` is created before the output section for `.rela.text.foo`. --------- Co-authored-by: Fangrui Song <i@maskray.me>
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.