Skip to content

[LLD] Crash when relocations proceed relocated section in Orphan Sections Initialization #156417

@mykouHW

Description

@mykouHW

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions