diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td index 0174d2126f56..b6db388552f8 100644 --- a/lld/ELF/Options.td +++ b/lld/ELF/Options.td @@ -27,11 +27,11 @@ def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"">, 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; def alias_soname_soname: S<"soname">, Alias; def alias_strip_all: Flag<["-"], "s">, Alias; def alias_strip_debug_S: Flag<["-"], "S">, Alias; +def alias_Tbss: J<"Tbss=">, Alias; +def alias_Tdata: J<"Tdata=">, Alias; def alias_trace: Flag<["-"], "t">, Alias; def alias_trace_symbol_y : JoinedOrSeparate<["-"], "y">, Alias; +def alias_Ttext: J<"Ttext=">, Alias; def alias_undefined_eq: J<"undefined=">, Alias; def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias; def alias_version_V: Flag<["-"], "V">, Alias; diff --git a/lld/test/ELF/sectionstart.s b/lld/test/ELF/sectionstart.s index 4329952ab216..d0f5293dd9e1 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