[lld] r288832 - [ELF] - Teach LLD to recognize PT_OPENBSD_BOOTDATA
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 09:57:43 PST 2016
Author: grimar
Date: Tue Dec 6 11:57:42 2016
New Revision: 288832
URL: http://llvm.org/viewvc/llvm-project?rev=288832&view=rev
Log:
[ELF] - Teach LLD to recognize PT_OPENBSD_BOOTDATA
Minor patch to fix PR31288
OpenBSD commit:
https://github.com/openbsd/src/commit/d39116912b9536bd77326260dc5c6e593fd4ee24
Differential revision: https://reviews.llvm.org/D27458
Added:
lld/trunk/test/ELF/linkerscript/openbsd-bootdata.s
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=288832&r1=288831&r2=288832&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Dec 6 11:57:42 2016
@@ -1859,6 +1859,7 @@ unsigned ScriptParser::readPhdrType() {
.Case("PT_GNU_RELRO", PT_GNU_RELRO)
.Case("PT_OPENBSD_RANDOMIZE", PT_OPENBSD_RANDOMIZE)
.Case("PT_OPENBSD_WXNEEDED", PT_OPENBSD_WXNEEDED)
+ .Case("PT_OPENBSD_BOOTDATA", PT_OPENBSD_BOOTDATA)
.Default(-1);
if (Ret == (unsigned)-1) {
Added: lld/trunk/test/ELF/linkerscript/openbsd-bootdata.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/openbsd-bootdata.s?rev=288832&view=auto
==============================================================================
--- lld/trunk/test/ELF/linkerscript/openbsd-bootdata.s (added)
+++ lld/trunk/test/ELF/linkerscript/openbsd-bootdata.s Tue Dec 6 11:57:42 2016
@@ -0,0 +1,7 @@
+# RUN: llvm-mc -filetype=obj -triple=i686-unknown-linux %s -o %t.o
+# RUN: echo "PHDRS { boot PT_OPENBSD_BOOTDATA; }" > %t.script
+# RUN: ld.lld --script %t.script %t.o -o %t
+# RUN: llvm-readobj --program-headers -s %t | FileCheck %s
+
+# CHECK: ProgramHeader {
+# CHECK: Type: PT_OPENBSD_BOOTDATA (0x65A41BE6)
More information about the llvm-commits
mailing list