HomePhabricator

[ELF] Keep orphan section names (.rodata.foo .text.foo) unchanged if !

Authored by MaskRay on Feb 25 2020, 6:00 PM.

Description

[ELF] Keep orphan section names (.rodata.foo .text.foo) unchanged if !hasSectionsCommand

This behavior matches GNU ld and seems reasonable.

// If a SECTIONS command is not specified
.text.* -> .text
.rodata.* -> .rodata
.init_array.* -> .init_array

A proposed Linux feature CONFIG_FG_KASLR may depend on the GNU ld behavior.

Reword a comment about -z keep-text-section-prefix and a comment about
CommonSection (deleted by rL286234).

Reviewed By: grimar

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

Details

Committed
MaskRayMar 23 2020, 10:30 AM
Reviewer
grimar
Differential Revision
D75225: [ELF] Keep orphan section names (.rodata.foo .text.foo) unchanged if !hasSectionsCommand
Parents
rG9607a119bd5e: [gn build] Port 57b8a407493
Branches
Unknown
Tags
Unknown