* ldlex.h (OPTION_TLDATA_SEGMENT): New enum value.
* lexsup.c (ld_options): Add -Tldata-segment.
(parse_args): Handle OPTION_TLDATA_SEGMENT.
* scripttempl/elf.sc: Support LARGE_DATA_ADDR.
+2013-01-14 Leif Ekblad <leif@rdos.net>
+ Alan Modra <amodra@gmail.com>
+
+ * ld.texinfo (-Tldata-segment): Describe.
+ * ldlex.h (OPTION_TLDATA_SEGMENT): New enum value.
+ * lexsup.c (ld_options): Add -Tldata-segment.
+ (parse_args): Handle OPTION_TLDATA_SEGMENT.
+ * scripttempl/elf.sc: Support LARGE_DATA_ADDR.
+
2013-01-10 H.J. Lu <hongjiu.lu@intel.com>
* deffilep.y: Remove trailing white spaces.
the read-only data is in its own segment separate from the executable
text, it will set the address of the first byte of the read-only data segment.
+@kindex -Tldata-segment=@var{org}
+@item -Tldata-segment=@var{org}
+@cindex ldata segment origin, cmd line
+When creating an ELF executable or shared object for x86-64 medium memory
+model, it will set the address of the first byte of the ldata segment.
+
@kindex --unresolved-symbols
@item --unresolved-symbols=@var{method}
Determine how to handle unresolved symbols. There are four possible
OPTION_TTEXT,
OPTION_TTEXT_SEGMENT,
OPTION_TRODATA_SEGMENT,
+ OPTION_TLDATA_SEGMENT,
OPTION_TRADITIONAL_FORMAT,
OPTION_UR,
OPTION_VERBOSE,
'\0', N_("ADDRESS"), N_("Set address of text segment"), ONE_DASH },
{ {"Trodata-segment", required_argument, NULL, OPTION_TRODATA_SEGMENT},
'\0', N_("ADDRESS"), N_("Set address of rodata segment"), ONE_DASH },
+ { {"Tldata-segment", required_argument, NULL, OPTION_TLDATA_SEGMENT},
+ '\0', N_("ADDRESS"), N_("Set address of ldata segment"), ONE_DASH },
{ {"unresolved-symbols=<method>", required_argument, NULL,
OPTION_UNRESOLVED_SYMBOLS},
'\0', NULL, N_("How to handle unresolved symbols. <method> is:\n"
case OPTION_TRODATA_SEGMENT:
set_segment_start (".rodata-segment", optarg);
break;
+ case OPTION_TLDATA_SEGMENT:
+ set_segment_start (".ldata-segment", optarg);
+ break;
case OPTION_TRADITIONAL_FORMAT:
link_info.traditional_format = TRUE;
break;
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
+EOF
+
+LARGE_DATA_ADDR=". = SEGMENT_START(\"ldata-segment\", ${LARGE_DATA_ADDR-.});"
+SHLIB_LARGE_DATA_ADDR=". = SEGMENT_START(\"ldata-segment\", ${SHLIB_LARGE_DATA_ADDR-.});"
+
+ cat <<EOF
+ ${RELOCATING+${CREATE_SHLIB-${CREATE_PIE-${LARGE_DATA_ADDR}}}}
+ ${RELOCATING+${CREATE_SHLIB+${SHLIB_LARGE_DATA_ADDR}}}
+ ${RELOCATING+${CREATE_PIE+${SHLIB_LARGE_DATA_ADDR}}}
${LARGE_SECTIONS}
${LARGE_BSS_AFTER_BSS-${LARGE_BSS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}