<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 2, 2016 at 9:06 AM, George Rimar via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: grimar<br>
Date: Wed Nov 2 11:06:00 2016<br>
New Revision: 285824<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=285824&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=285824&view=rev</a><br>
Log:<br>
[ELF] - Allow "-Ttext xxx", "-Tbss xxx", "-Tdata bss" commandline.<br>
<br>
So patch just defines an alias for -Txxx=YYY forms,<br>
this is consistent with ld and should fix PR30814.<br>
<br>
Modified:<br>
lld/trunk/ELF/Options.td<br>
lld/trunk/test/ELF/<wbr>sectionstart.s<br>
<br>
Modified: lld/trunk/ELF/Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=285824&r1=285823&r2=285824&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/Options.<wbr>td?rev=285824&r1=285823&r2=<wbr>285824&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/Options.td (original)<br>
+++ lld/trunk/ELF/Options.td Wed Nov 2 11:06:00 2016<br>
@@ -27,11 +27,11 @@ def L: JoinedOrSeparate<["-"], "L">, Met<br>
<br>
def O: Joined<["-"], "O">, HelpText<"Optimize output file size">;<br>
<br>
-def Tbss: J<"Tbss=">, HelpText<"Same as --section-start with .bss as the sectionname">;<br>
+def Tbss: Separate<["-"], "Tbss">, HelpText<"Same as --section-start with .bss as the sectionname">;<br>
<br>
-def Tdata: J<"Tdata=">, HelpText<"Same as --section-start with .data as the sectionname">;<br>
+def Tdata: Separate<["-"], "Tdata">, HelpText<"Same as --section-start with .data as the sectionname">;<br>
<br>
-def Ttext: J<"Ttext=">, HelpText<"Same as --section-start with .text as the sectionname">;<br>
+def Ttext: Separate<["-"], "Ttext">, HelpText<"Same as --section-start with .text as the sectionname">;<br></blockquote><div><br></div><div>Please use S instead of Separate because we want to accept both -Tbss and --Tbss.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
def allow_multiple_definition: F<"allow-multiple-definition"><wbr>,<br>
HelpText<"Allow multiple definitions">;<br>
@@ -252,8 +252,11 @@ def alias_soname_h: JoinedOrSeparate<["-<br>
def alias_soname_soname: S<"soname">, Alias<soname>;<br>
def alias_strip_all: Flag<["-"], "s">, Alias<strip_all>;<br>
def alias_strip_debug_S: Flag<["-"], "S">, Alias<strip_debug>;<br>
+def alias_Tbss: J<"Tbss=">, Alias<Tbss>;<br>
+def alias_Tdata: J<"Tdata=">, Alias<Tdata>;<br>
def alias_trace: Flag<["-"], "t">, Alias<trace>;<br>
def alias_trace_symbol_y : JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>;<br>
+def alias_Ttext: J<"Ttext=">, Alias<Ttext>;<br>
def alias_undefined_eq: J<"undefined=">, Alias<undefined>;<br>
def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias<undefined>;<br>
def alias_version_V: Flag<["-"], "V">, Alias<version>;<br>
<br>
Modified: lld/trunk/test/ELF/<wbr>sectionstart.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/sectionstart.s?rev=285824&r1=285823&r2=285824&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/test/ELF/<wbr>sectionstart.s?rev=285824&r1=<wbr>285823&r2=285824&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/test/ELF/<wbr>sectionstart.s (original)<br>
+++ lld/trunk/test/ELF/<wbr>sectionstart.s Wed Nov 2 11:06:00 2016<br>
@@ -24,6 +24,10 @@<br>
# RUN: ld.lld %t.o -Ttext=100000 -Tdata=110000 -Tbss=200000 -o %t5<br>
# RUN: llvm-objdump -section-headers %t5 | FileCheck %s<br>
<br>
+## Check form without assignment:<br>
+# RUN: ld.lld %t.o -Ttext 0x100000 -Tdata 0x110000 -Tbss 0x200000 -o %t4<br>
+# RUN: llvm-objdump -section-headers %t4 | FileCheck %s<br>
+<br>
## Errors:<br>
# RUN: not ld.lld %t.o --section-start .text100000 -o %t2 2>&1 \<br>
# RUN: | FileCheck -check-prefix=ERR1 %s<br>
@@ -35,15 +39,15 @@<br>
<br>
# RUN: not ld.lld %t.o -Ttext=1w0000 -o %t6 2>&1 \<br>
# RUN: | FileCheck -check-prefix=ERR3 %s<br>
-# ERR3: invalid argument: -Ttext=1w0000<br>
+# ERR3: invalid argument: -Ttext 1w0000<br>
<br>
# RUN: not ld.lld %t.o -Tbss=1w0000 -o %t6 2>&1 \<br>
# RUN: | FileCheck -check-prefix=ERR4 %s<br>
-# ERR4: invalid argument: -Tbss=1w0000<br>
+# ERR4: invalid argument: -Tbss 1w0000<br>
<br>
# RUN: not ld.lld %t.o -Tdata=1w0000 -o %t6 2>&1 \<br>
# RUN: | FileCheck -check-prefix=ERR5 %s<br>
-# ERR5: invalid argument: -Tdata=1w0000<br>
+# ERR5: invalid argument: -Tdata 1w0000<br>
<br>
.text<br>
.globl _start<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>