[PATCH] D69895: [yaml2obj/obj2yaml] - Add support for SHT_LLVM_LINKER_OPTIONS sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 04:35:02 PST 2019


grimar updated this revision to Diff 228412.
grimar added a comment.

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

https://reviews.llvm.org/D69895

Files:
  llvm/test/tools/llvm-readobj/elf-linker-options.ll
  llvm/test/tools/llvm-readobj/elf-linker-options.test


Index: llvm/test/tools/llvm-readobj/elf-linker-options.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-readobj/elf-linker-options.test
@@ -0,0 +1,30 @@
+## Check that we can use --elf-linker-options option
+## to dump SHT_LLVM_LINKER_OPTIONS sections.
+
+# RUN: yaml2obj %s -o %t1
+# RUN: llvm-readobj --elf-linker-options %t1 | FileCheck %s
+
+# CHECK:      LinkerOptions [
+# CHECK-NEXT:  option 0: value 0
+# CHECK-NEXT:  option 1: value 1
+# CHECK-NEXT: ]
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  Type:    ET_REL
+  Machine: EM_X86_64
+Sections:
+  - Name: .linker-options
+    Type: SHT_LLVM_LINKER_OPTIONS
+    Options:
+      - Name:  option 0
+        Value: value 0
+      - Name:  option 1
+        Value: value 1
+
+## llvm-readelf doesn't support --elf-linker-options yet.
+# RUN: llvm-readelf --elf-linker-options %t1 2>&1 | FileCheck %s --check-prefix=READELF
+
+# READELF: printELFLinkerOptions not implemented!
Index: llvm/test/tools/llvm-readobj/elf-linker-options.ll
===================================================================
--- llvm/test/tools/llvm-readobj/elf-linker-options.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llc -mtriple x86_64-elf -filetype obj -o - %s | llvm-readobj --elf-linker-options - | FileCheck %s
-; REQUIRES: x86-registered-target
-
-!llvm.linker.options = !{!0, !1}
-
-!0 = !{!"option 0", !"value 0"}
-!1 = !{!"option 1", !"value 1"}
-
-; CHECK: LinkerOptions [
-; CHECK:  option 0: value 0
-; CHECK:  option 1: value 1
-; CHECK: ]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69895.228412.patch
Type: text/x-patch
Size: 1581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191108/da6f8fdf/attachment.bin>


More information about the llvm-commits mailing list