From: Alan Modra Date: Mon, 14 Jan 2013 13:37:10 +0000 (+0000) Subject: * ld.texinfo (-Tldata-segment): Describe. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d705e9f94332dec93970e80afec6c667c79f555;p=binutils-gdb.git * 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 860f05a872c..cfbe79981ed 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2013-01-14 Leif Ekblad + Alan Modra + + * 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 * deffilep.y: Remove trailing white spaces. diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 4777ad50aca..2429668728c 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 533a55bb411..99f4282a392 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 4fd929a6ba5..2f717502465 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=", required_argument, NULL, OPTION_UNRESOLVED_SYMBOLS}, '\0', NULL, N_("How to handle unresolved symbols. 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 cf3f6d8c745..bbff2337e45 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -608,6 +608,15 @@ cat <