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

Rui Ueyama via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 19 18:08:59 PST 2016


LGTM

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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161219/4e24496f/attachment.html>


More information about the llvm-dev mailing list