[PATCH] D87219: [ELF] Merge .openbsd.randomdata.* sections into a single .openbsd.randomdata section when linking

Brad Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 17:17:59 PDT 2020


brad added a comment.

I spoke to the author of the diff and asked for some feedback. He said...

Picking a random userland .o file from the build: readelf -a shows that it 
contain multiple randomdata sections:

  .openbsd.randomdata.retguard.130
  .openbsd.randomdata.retguard.236
  .openbsd.randomdata.retguard.2936
  .openbsd.randomdata.retguard.443
  .openbsd.randomdata.retguard.2600

The suffix here is a hash generated by the compiler.  This is something 
done by default by the compiler on openbsd, so if we were to instead use a 
linker script for this then (almost) *EVERY* program built on openbsd 
would require a linker script.

As for "isn't this useless without putting them in PT_OPENBSD_RANDOMIZE 
segment", well, sure, so add the four chunks under gnu/llvm which define & 
mention that symbol...but I think some may argue that doing that should 
only be done if the binary's 'OS' field in the header is the openbsd 
value, so that may create a different kind of pushback.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87219



More information about the llvm-commits mailing list