https://bugs.llvm.org/show_bug.cgi?id=36555
Rafael Ávila de Espíndola <raf...@espindo.la> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|WONTFIX |---
Status|RESOLVED |REOPENED
--- Comment #9 from Rafael Ávila de Espíndola <raf...@espindo.la> ---
(In reply to Rafael Ávila de Espíndola from comment #8)
> > With this in mind I think our best course of action is:
> > - Extend writeGotPltHeader() to more targets.
> > - Either adjust the default section sorting to make sure .got.plt follows
> > .got or change _GLOBAL_OFFSET_TABLE_ to the start of the .got.plt.
>
> Interesting. This would mean flipping relro to the start of the RW program
> header since .got is RELRO and .got.plt is not.
>
> I will dig at the history a bit to see why we have the current order.
Found it.
The reason is that we need to have a single RelRO area covering nobits and non
nobits sections. Since bss has to go at the end, so has RelRo:
// We place nobits RelRo sections before plain r/w ones, and non-nobits RelRo
// sections after r/w ones, so that the RelRo sections are contiguous.
bool IsRelRo = isRelroSection(Sec);
if (IsNonTlsNoBits && !IsRelRo)
Rank |= RF_NON_TLS_BSS_RO;
if (!IsNonTlsNoBits && IsRelRo)
Rank |= RF_NON_TLS_BSS_RO;
My understanding is that gnu linker just never use a RelRO nobits sections.
It seems we have to make the section _GLOBAL_OFFSET_TABLE_ points to
architecture dependent or change glibc (not sure how realistic that is).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs