Without this patch, the following script triggers link error
SECTIONS {
.init_array : { __init_array_start = .; *(.init_array) __init_array_end = .; }
} Differential D23405
[ELF] Do not add start and end symbols in case they are defined in linker script Authored by evgeny777 on Aug 11 2016, 6:01 AM.
Details
Without this patch, the following script triggers link error SECTIONS {
.init_array : { __init_array_start = .; *(.init_array) __init_array_end = .; }
}
Diff Detail Event TimelineComment Actions This change seems too subtle. Why don't you not call addStartEndSymbols if Scripts->HasContents? Comment Actions I thought it would make sense to add those symbols if linker script does not provide them for some reason. For example .init_array can be an orphan section, right? Also I wonder what would happen if I define __init_array_start somewhere in my program. Comment Actions Ah, okay, so this change is not really specific to the linker script, but to not define _start/_end symbols if there are already definitions. You want to add a comment about that.
Comment Actions LGTM
| ||||||||||||||
Is Required a good name? Maybe I'd name this simply addSynthetic and add a comment to describe its semantics (defines a symbol unless there's already a defined symbol with the same name.)