[llvm-dev] LLD : __start_ and __end_ symbols for orphan sections

Fangrui Song via llvm-dev llvm-dev at lists.llvm.org
Thu May 28 23:30:42 PDT 2020


On 2020-05-28, Moshtaghi, Alireza via llvm-dev wrote:
>lld does not seem to create the __start and __end symbols for orphan sections.
>I would like to keep my linker script as generic as possible so how can I tell lld to create these symbols without having to add them in the linker script?
>
>Thanks
>A

It works for me.

SECTIONS {
   data : { *(data) }
}

.section data,"aw"
.quad __start_orphan
.quad __stop_orphan

.section orphan,"aw"
.quad __start_data
.quad __stop_data


Can you give an example __start_ or __end_ symbols are not defined for orphan sections?


More information about the llvm-dev mailing list