[PATCH] D13668: [ELF2/LinkerScript] Fix OUTPUT_FORMAT directive parsing

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 13:17:47 PDT 2015


ruiu added a comment.

s/OUTPUT_ARCH/OUTPUT_FORMAT/

Rename linkerscript-outputgroup.s -> linkerscript-outputformat.s.

Regarding better error handling, I don't think now is the right time to do something about that. This parser is a designed to be just enough to read Linux's libc.so, and this should suffice until we link something like a OS kernel, so designing a linker script that is capable more than this one is in my opinion relatively low priority.


================
Comment at: ELF/LinkerScript.cpp:222
@@ +221,3 @@
+      next();
+      continue;
+    error("unexpected token: " + Tok);
----------------
Wrong indentation.

================
Comment at: test/elf2/linkerscript-ouputgroup.s:2
@@ +1,3 @@
+# REQUIRES: x86
+# RUN: echo "OUTPUT_FORMAT(\"elf64-x86-64\")" > %t.script
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %t1
----------------
You also need a test for OUTPUT_FORMAT(default, big, little)-style directive.


http://reviews.llvm.org/D13668





More information about the llvm-commits mailing list