sync with OpenBSD -current
This commit is contained in:
parent
02d83d01a6
commit
005bcb25db
29 changed files with 312 additions and 230 deletions
|
@ -1577,6 +1577,7 @@ unsigned ScriptParser::readPhdrType() {
|
|||
.Case("PT_GNU_RELRO", PT_GNU_RELRO)
|
||||
.Case("PT_OPENBSD_MUTABLE", PT_OPENBSD_MUTABLE)
|
||||
.Case("PT_OPENBSD_RANDOMIZE", PT_OPENBSD_RANDOMIZE)
|
||||
.Case("PT_OPENBSD_SYSCALLS", PT_OPENBSD_SYSCALLS)
|
||||
.Case("PT_OPENBSD_WXNEEDED", PT_OPENBSD_WXNEEDED)
|
||||
.Case("PT_OPENBSD_BOOTDATA", PT_OPENBSD_BOOTDATA)
|
||||
.Default(-1);
|
||||
|
|
|
@ -2388,6 +2388,11 @@ SmallVector<PhdrEntry *, 0> Writer<ELFT>::createPhdrs(Partition &part) {
|
|||
if (OutputSection *cmd = findSection(".openbsd.randomdata", partNo))
|
||||
addHdr(PT_OPENBSD_RANDOMIZE, cmd->getPhdrFlags())->add(cmd);
|
||||
|
||||
// PT_OPENBSD_SYSCALLS is an OpenBSD-specific feature. That makes
|
||||
// the kernel and dynamic linker register system call sites.
|
||||
if (OutputSection *cmd = findSection(".openbsd.syscalls", partNo))
|
||||
addHdr(PT_OPENBSD_SYSCALLS, cmd->getPhdrFlags())->add(cmd);
|
||||
|
||||
if (config->zGnustack != GnuStackKind::None) {
|
||||
// PT_GNU_STACK is a special section to tell the loader to make the
|
||||
// pages for the stack non-executable. If you really want an executable
|
||||
|
|
|
@ -1405,6 +1405,7 @@ enum {
|
|||
PT_OPENBSD_RANDOMIZE = 0x65a3dbe6, // Fill with random data.
|
||||
PT_OPENBSD_WXNEEDED = 0x65a3dbe7, // Program does W^X violations.
|
||||
PT_OPENBSD_NOBTCFI = 0x65a3dbe8, // Do not enforce branch target CFI
|
||||
PT_OPENBSD_SYSCALLS = 0x65a3dbe9, // System call sites.
|
||||
PT_OPENBSD_BOOTDATA = 0x65a41be6, // Section for boot arguments.
|
||||
|
||||
// ARM program header types.
|
||||
|
|
|
@ -259,6 +259,9 @@ static void printProgramHeaders(const ELFFile<ELFT> &Obj, StringRef FileName) {
|
|||
case ELF::PT_OPENBSD_RANDOMIZE:
|
||||
outs() << "OPENBSD_RANDOMIZE ";
|
||||
break;
|
||||
case ELF::PT_OPENBSD_SYSCALLS:
|
||||
outs() << "OPENBSD_SYSCALLS ";
|
||||
break;
|
||||
case ELF::PT_OPENBSD_WXNEEDED:
|
||||
outs() << "OPENBSD_WXNEEDED ";
|
||||
break;
|
||||
|
|
|
@ -1411,6 +1411,7 @@ static StringRef segmentTypeToString(unsigned Arch, unsigned Type) {
|
|||
|
||||
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_MUTABLE);
|
||||
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_RANDOMIZE);
|
||||
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_SYSCALLS);
|
||||
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_WXNEEDED);
|
||||
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_NOBTCFI);
|
||||
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_BOOTDATA);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue