diff options
| -rw-r--r-- | lld/ELF/Options.td | 9 | ||||
| -rw-r--r-- | lld/test/ELF/sectionstart.s | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td index 0174d2126f5..b6db388552f 100644 --- a/lld/ELF/Options.td +++ b/lld/ELF/Options.td @@ -27,11 +27,11 @@ def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">, def O: Joined<["-"], "O">, HelpText<"Optimize output file size">; -def Tbss: J<"Tbss=">, HelpText<"Same as --section-start with .bss as the sectionname">; +def Tbss: Separate<["-"], "Tbss">, HelpText<"Same as --section-start with .bss as the sectionname">; -def Tdata: J<"Tdata=">, HelpText<"Same as --section-start with .data as the sectionname">; +def Tdata: Separate<["-"], "Tdata">, HelpText<"Same as --section-start with .data as the sectionname">; -def Ttext: J<"Ttext=">, HelpText<"Same as --section-start with .text as the sectionname">; +def Ttext: Separate<["-"], "Ttext">, HelpText<"Same as --section-start with .text as the sectionname">; def allow_multiple_definition: F<"allow-multiple-definition">, HelpText<"Allow multiple definitions">; @@ -252,8 +252,11 @@ def alias_soname_h: JoinedOrSeparate<["-"], "h">, Alias<soname>; def alias_soname_soname: S<"soname">, Alias<soname>; def alias_strip_all: Flag<["-"], "s">, Alias<strip_all>; def alias_strip_debug_S: Flag<["-"], "S">, Alias<strip_debug>; +def alias_Tbss: J<"Tbss=">, Alias<Tbss>; +def alias_Tdata: J<"Tdata=">, Alias<Tdata>; def alias_trace: Flag<["-"], "t">, Alias<trace>; def alias_trace_symbol_y : JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>; +def alias_Ttext: J<"Ttext=">, Alias<Ttext>; def alias_undefined_eq: J<"undefined=">, Alias<undefined>; def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias<undefined>; def alias_version_V: Flag<["-"], "V">, Alias<version>; diff --git a/lld/test/ELF/sectionstart.s b/lld/test/ELF/sectionstart.s index 4329952ab21..d0f5293dd9e 100644 --- a/lld/test/ELF/sectionstart.s +++ b/lld/test/ELF/sectionstart.s @@ -24,6 +24,10 @@ # RUN: ld.lld %t.o -Ttext=100000 -Tdata=110000 -Tbss=200000 -o %t5 # RUN: llvm-objdump -section-headers %t5 | FileCheck %s +## Check form without assignment: +# RUN: ld.lld %t.o -Ttext 0x100000 -Tdata 0x110000 -Tbss 0x200000 -o %t4 +# RUN: llvm-objdump -section-headers %t4 | FileCheck %s + ## Errors: # RUN: not ld.lld %t.o --section-start .text100000 -o %t2 2>&1 \ # RUN: | FileCheck -check-prefix=ERR1 %s @@ -35,15 +39,15 @@ # RUN: not ld.lld %t.o -Ttext=1w0000 -o %t6 2>&1 \ # RUN: | FileCheck -check-prefix=ERR3 %s -# ERR3: invalid argument: -Ttext=1w0000 +# ERR3: invalid argument: -Ttext 1w0000 # RUN: not ld.lld %t.o -Tbss=1w0000 -o %t6 2>&1 \ # RUN: | FileCheck -check-prefix=ERR4 %s -# ERR4: invalid argument: -Tbss=1w0000 +# ERR4: invalid argument: -Tbss 1w0000 # RUN: not ld.lld %t.o -Tdata=1w0000 -o %t6 2>&1 \ # RUN: | FileCheck -check-prefix=ERR5 %s -# ERR5: invalid argument: -Tdata=1w0000 +# ERR5: invalid argument: -Tdata 1w0000 .text .globl _start |

