[llvm-dev] [lld] Treat .openbsd.randomdata as read-only

Mark Kettenis via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 20 02:55:13 PST 2016


> From: Rui Ueyama <ruiu at google.com>
> Date: Mon, 19 Dec 2016 20:08:59 -0600
> 
> LGTM

Great.  I don't have commit access, so it would be great if you could
commit this change for me.

Just realized that that I should have sent this to llvm-commits
instead.  Apologies for that.

I have some further fixes.  Is Phabricator preferred these days for
submitting patches?

Thanks,

Mark

> On Mon, Dec 19, 2016 at 1:48 PM, Mark Kettenis via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
> 
> > It is the intention that .openbsd.randomdata sections are made
> > read-only after initialization.  The native (ld.bfd based) OpenBSD
> > toolchain accomplishes this by including .openbsd.randomdata into the
> > PT_GNU_RELRO segment.  The diff below makes ldd do the same.
> >
> > Index: ELF/Writer.cpp
> > ===================================================================
> > --- ELF/Writer.cpp      (revision 290066)
> > +++ ELF/Writer.cpp      (working copy)
> > @@ -504,7 +504,7 @@
> >      return true;
> >    StringRef S = Sec->getName();
> >    return S == ".data.rel.ro" || S == ".ctors" || S == ".dtors" || S ==
> > ".jcr" ||
> > -         S == ".eh_frame";
> > +         S == ".eh_frame" || S == ".openbsd.randomdata";
> >  }
> >
> >  template <class ELFT>
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >


More information about the llvm-dev mailing list