[PATCH] D65478: Create unique, but identically-named ELF sections for explicitly-sectioned functions and globals when using -function-sections and -data-sections.

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 15:45:54 PDT 2019


rahmanl added a comment.

In D65478#1620005 <https://reviews.llvm.org/D65478#1620005>, @pcc wrote:

> In D65478#1619990 <https://reviews.llvm.org/D65478#1619990>, @rahmanl wrote:
>
> > In D65478#1619713 <https://reviews.llvm.org/D65478#1619713>, @inglorion wrote:
> >
> > > Unfortunately, this causes some problems. It looks like the sections are created with different attributes than the original. This causes problems such as sections being writable when the original was read-only, including https://crbug.com/990942 where that causes program crashes. There is some more discussion on that bug report.
> > >
> > > I'll revert this to unbreak the Chromium build, and we can come up with a way forward from there.
> >
> >
> > Hi Bob, 
> >  We plan to gate this feature behind a condition: D65837 <https://reviews.llvm.org/D65837> 
> >  I think in the Chromium case, what it needs is the -funique-section-names. More precisely, Chromium needs this flag only for the explicitly defined section "protected_memory", but I don't think it hurts to do it globally ( Chromium build may actually be using this flag anyways. Please confirm.)
> >  If you think that the chromium build could use this flag, I will change D65837 <https://reviews.llvm.org/D65837> to do the check.
>
>
> Chromium is depending on an implementation detail here and the revert is temporary until we can land a compiler feature that will let us avoid the implementation detail dependence. It doesn't seem necessary to change the condition that you've already implemented in D65837 <https://reviews.llvm.org/D65837>.


Agreed.
However, I was thinking that the implementation detail relies on the assumption that only one section exists of the name "protected_memory" and if we somehow let the programmer specify that a particular section name can only appear once, it would resolve the problem. Enforcing the use of funique-section-names does look overkill.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65478/new/

https://reviews.llvm.org/D65478





More information about the llvm-commits mailing list