From: Nick Clifton Date: Mon, 27 Jun 2016 15:35:58 +0000 (+0100) Subject: Allow a second -T
= to override a previous version on the same linker... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42b7a39bf6eb2e90fb1b07c2d53d7a93263508d2;p=binutils-gdb.git Allow a second -T
= to override a previous version on the same linker command line. PR ld/20302 * lexsup.c (set_segment_start): If resetting the start address of a section, remember to generate a new script element as well. * testsuite/ld-scripts/pr20302.d: New test. * testsuite/ld-scripts/scripts.exp: Run the new test. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 50adaee6199..c1b7f45c03d 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2016-06-27 Nick Clifton + + PR ld/20302 + * lexsup.c (set_segment_start): If resetting the start address of + a section, remember to generate a new script element as well. + * testsuite/ld-scripts/pr20302.d: New test. + * testsuite/ld-scripts/scripts.exp: Run the new test. + 2016-06-24 Alan Modra * testsuite/ld-aarch64/aarch64-elf.exp (aarch64_choose_ilp32_emul): diff --git a/ld/lexsup.c b/ld/lexsup.c index 7f8146ca357..6d28e9142b0 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1686,6 +1686,7 @@ set_segment_start (const char *section, char *valstr) if (strcmp (seg->name, name) == 0) { seg->value = val; + lang_section_start (section, exp_intop (val), seg); return; } /* There was no existing value so we must create a new segment diff --git a/ld/testsuite/ld-scripts/pr20302.d b/ld/testsuite/ld-scripts/pr20302.d new file mode 100644 index 00000000000..ec655dd2b19 --- /dev/null +++ b/ld/testsuite/ld-scripts/pr20302.d @@ -0,0 +1,12 @@ +#ld: -Tdata=0x1000 -Tdata=0x2000 -Tcross2.t +#source: align2a.s +#objdump: -h +#notarget: rx-*-* *-*-aout *-*-netbsd x86_64-*-cygwin *-*-vms +# RX uses non standard section names. +# AOUT and NETBSD have fixed address for the data section. +# x86_64 Cygwin biases all start addresses to be > 2Gb. +# VMS targets need extra libraries. + +#... + . \.data[ ]+0+[0-9a-f]+[ ]+0+02000[ ]+0+02000.* +#pass diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp index b178cb3d2ea..1b19202818f 100644 --- a/ld/testsuite/ld-scripts/script.exp +++ b/ld/testsuite/ld-scripts/script.exp @@ -230,3 +230,4 @@ foreach test_script $test_script_list { } run_dump_test "align-with-input" +run_dump_test "pr20302"