https://sourceware.org/bugzilla/show_bug.cgi?id=26268
Fangrui Song <i at maskray dot me> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |--- Status|RESOLVED |UNCONFIRMED --- Comment #2 from Fangrui Song <i at maskray dot me> --- (In reply to Andreas Schwab from comment #1) > A relocatable link doesn't create __start and __end symbols, thus the > undefined reference to __start_cident is not related to any section. Use > -Ur if you want them. The documentation says -Ur is equivalent to -r for non-C++ programs @kindex -Ur @cindex constructors @item -Ur For anything other than C++ programs, this option is equivalent to @samp{-r}: it generates relocatable output---i.e., an output file that can in turn serve as input to @command{ld}. When linking C++ programs, @samp{-Ur} @emph{does} resolve references to constructors, unlike @samp{-r}. It does not work to use @samp{-Ur} on files that were themselves linked with @samp{-Ur}; once the constructor table has been built, it cannot be added to. Use @samp{-Ur} only for the last partial link, and @samp{-r} for the others. ld -r is allowed to not defined __start_cindent, but it should not discard the sections. Not only -u __start_cindent does not retain 'cindent', a relocation '.quad __start_cindent' does not retain 'cindent' as well. I don't think this is invalid. -- You are receiving this mail because: You are on the CC list for the bug.