-Ur option documentation
Fangrui Song
i@maskray.me
Mon May 8 19:08:00 GMT 2023
On Mon, May 8, 2023 at 3:47 AM Florian Weimer via Binutils
<binutils@sourceware.org> wrote:
>
> * Andreas Schwab:
>
> > On Mai 05 2023, Florian Weimer via Binutils wrote:
> >
> >> The manual says this:
> >>
> >> '-Ur'
> >> For anything other than C++ programs, this option is equivalent to
> >> '-r': it generates relocatable output--i.e., an output file that
> >> can in turn serve as input to 'ld'. When linking C++ programs,
> >> '-Ur' _does_ resolve references to constructors, unlike '-r'. It
> >> does not work to use '-Ur' on files that were themselves linked
> >> with '-Ur'; once the constructor table has been built, it cannot be
> >> added to. Use '-Ur' only for the last partial link, and '-r' for
> >> the others.
> >>
> >> For ELF, this refers to the legacy init function, right?
> >
> > No, it refers to the a.out N_SETx symbols.
>
> So this doesn't matter to ELF at all? Would it be possible to update
> the documentation accordingly?
>
> Thanks,
> Florian
>
Anecdotally, -Ur may be so obscure that nearly no project uses. ld.lld
doesn't implement this option and I haven't heard of any distribution
using ld.lld having broken packages due to -Ur...
More information about the Binutils
mailing list