config->searchPaths = args::getStrings(args, OPT_library_path);
config->sectionStartMap = getSectionStartMap(args);
config->shared = args.hasArg(OPT_shared);
- config->singleRoRx = args.hasArg(OPT_no_rosegment);
+ config->singleRoRx = !args.hasFlag(OPT_rosegment, OPT_no_rosegment, true);
config->soName = args.getLastArgValue(OPT_soname);
config->sortSection = getSortSection(args);
config->splitStackAdjustSize = args::getInteger(args, OPT_split_stack_adjust_size, 16384);
def no_omagic: F<"no-omagic">, MetaVarName<"<magic>">,
HelpText<"Do not set the text data sections to be writable, page align sections (default)">;
-def no_rosegment: F<"no-rosegment">,
- HelpText<"Do not put read-only non-executable sections in their own segment">;
-
def no_undefined: F<"no-undefined">,
HelpText<"Report unresolved symbols even if the linker is creating a shared library">;
defm reproduce: Eq<"reproduce", "Write a tar file containing input files and command line options to reproduce link">;
+defm rosegment: B<"rosegment",
+ "Put read-only non-executable sections in their own segment (default)",
+ "Do not put read-only non-executable sections in their own segment">;
+
defm rpath: Eq<"rpath", "Add a DT_RUNPATH to the output">;
def relocatable: F<"relocatable">, HelpText<"Create relocatable object file">;
# RUN: ld.lld %t -o %t1
# RUN: llvm-readobj --program-headers %t1 | FileCheck --check-prefix=ROSEGMENT %s
-# RUN: ld.lld --omagic --no-omagic %t -o %t1
-# RUN: llvm-readobj --program-headers %t1 | FileCheck --check-prefix=ROSEGMENT %s
+# RUN: ld.lld --no-rosegment --rosegment %t -o - | cmp - %t1
+# RUN: ld.lld --omagic --no-omagic %t -o - | cmp - %t1
# ROSEGMENT: ProgramHeader {
# ROSEGMENT: Type: PT_LOAD