This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Support for .openbsd.randomdata and PT_OPENBSD_RANDOMIZE

I've added support to OpenBSD for a new OS-specific segment type
PT_OPENBSD_RANDOMIZE.  This segment indicates that the system is
responsible for initializing the specified memory range with random
data after loading the object into memory and before relocation
processing is applied.

Additionally, I modified OpenBSD's version of binutils to understand
the PT_OPENBSD_RANDOMIZE segment type and to emit a
PT_OPENBSD_RANDOMIZE segment when linking an ELF output that contains
a .openbsd.randomdata section.  (This allows code like "long
__stack_chk_guard __attribute__((section(".openbsd.randomdata")));" to
initialize a variable with random data without requiring any
constructor methods.)

Mark Kettenis thought that the binutils project might at least be
interested in the bits to make readelf understand PT_OPENBSD_RANDOMIZE
segments, so I ported the diff to latest GNU binutils.  See attached.


Attachment: openbsd-randomize.diff
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]