aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-01-14 13:37:10 +0000
committerAlan Modra <amodra@gmail.com>2013-01-14 13:37:10 +0000
commit0d705e9f94332dec93970e80afec6c667c79f555 (patch)
tree72b50754b08938a17dcbddd889102ac21d96d9c2
parentd6391ce5a607711d3db4847d0fa0dd3c00c289e2 (diff)
downloadgdb-0d705e9f94332dec93970e80afec6c667c79f555.zip
gdb-0d705e9f94332dec93970e80afec6c667c79f555.tar.gz
gdb-0d705e9f94332dec93970e80afec6c667c79f555.tar.bz2
* 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.
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/ld.texinfo6
-rw-r--r--ld/ldlex.h1
-rw-r--r--ld/lexsup.c5
-rw-r--r--ld/scripttempl/elf.sc9
5 files changed, 30 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 860f05a..cfbe799 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+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.
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 4777ad5..2429668 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1846,6 +1846,12 @@ When creating an ELF executable or shared object for a target where
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
diff --git a/ld/ldlex.h b/ld/ldlex.h
index 533a55b..99f4282 100644
--- a/ld/ldlex.h
+++ b/ld/ldlex.h
@@ -69,6 +69,7 @@ enum option_values
OPTION_TTEXT,
OPTION_TTEXT_SEGMENT,
OPTION_TRODATA_SEGMENT,
+ OPTION_TLDATA_SEGMENT,
OPTION_TRADITIONAL_FORMAT,
OPTION_UR,
OPTION_VERBOSE,
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 4fd929a..2f71750 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -446,6 +446,8 @@ static const struct ld_option ld_options[] =
'\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"
@@ -1199,6 +1201,9 @@ parse_args (unsigned argc, char **argv)
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;
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index cf3f6d8..bbff233 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -608,6 +608,15 @@ cat <<EOF
${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});}