From: H.J. Lu Date: Tue, 5 Feb 2013 01:36:05 +0000 (+0000) Subject: Don't enable new dtags by default with -rpath X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=663fa5434e06d80efc567e2aaa130bc17deb1257;p=binutils-gdb.git Don't enable new dtags by default with -rpath ld/ 2013-02-04 H.J. Lu PR ld/15096 * emultempl/alphaelf.em (alpha_after_parse): Call gld${EMULATION_NAME}_after_parse instead of after_parse_default. * emultempl/cr16elf.em (cr16elf_after_parse): Likewise. * emultempl/crxelf.em (crxelf_after_parse): Likewise. * emultempl/hppaelf.em (hppaelf_after_parse): Likewise. * emultempl/mipself.em (mips_after_parse): Likewise. * emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Renamed to ... (gld_${EMULATION_NAME}_after_parse): This. Call gld${EMULATION_NAME}_after_parse instead of after_parse_default. (LDEMUL_AFTER_PARSE): Set to gld_${EMULATION_NAME}_after_parse. * emultempl/elf32.em (new_dtags_set): New variable. (gld${EMULATION_NAME}_before_parse): Don't set link_info.new_dtags here. (gld${EMULATION_NAME}_after_parse): New function. (ld_${EMULATION_NAME}_emulation): Replace after_parse_default' with gld${EMULATION_NAME}_after_parse. (gld${EMULATION_NAME}_handle_option): Set new_dtags_set to TRUE when setting link_info.new_dtags. ld/testsuite/ 2013-02-04 H.J. Lu PR ld/15096 * ld-elf/new-dtags-1.d: New test. * ld-elf/new-dtags-2.d: Likewise. * ld-elf/new-dtags-3.d: Likewise. * ld-elf/new-dtags-4.d: Likewise. * ld-elf/new-dtags-5.d: Likewise. * ld-elf/new-dtags-6.d: Likewise. * ld-elf/new-dtags-7.d: Likewise. * ld-elf/new-dtags-8.d: Likewise. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index e8bbc9ba800..0a08753383b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,28 @@ +2013-02-04 H.J. Lu + + PR ld/15096 + * emultempl/alphaelf.em (alpha_after_parse): Call + gld${EMULATION_NAME}_after_parse instead of after_parse_default. + * emultempl/cr16elf.em (cr16elf_after_parse): Likewise. + * emultempl/crxelf.em (crxelf_after_parse): Likewise. + * emultempl/hppaelf.em (hppaelf_after_parse): Likewise. + * emultempl/mipself.em (mips_after_parse): Likewise. + + * emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Renamed + to ... + (gld_${EMULATION_NAME}_after_parse): This. Call + gld${EMULATION_NAME}_after_parse instead of after_parse_default. + (LDEMUL_AFTER_PARSE): Set to gld_${EMULATION_NAME}_after_parse. + + * emultempl/elf32.em (new_dtags_set): New variable. + (gld${EMULATION_NAME}_before_parse): Don't set link_info.new_dtags + here. + (gld${EMULATION_NAME}_after_parse): New function. + (ld_${EMULATION_NAME}_emulation): Replace after_parse_default' + with gld${EMULATION_NAME}_after_parse. + (gld${EMULATION_NAME}_handle_option): Set new_dtags_set to TRUE + when setting link_info.new_dtags. + 2013-01-25 Kai Tietz * deffilep.y (def_image_name): Adjust type of base-address diff --git a/ld/emultempl/alphaelf.em b/ld/emultempl/alphaelf.em index 21064ad8fb8..d44de52abd8 100644 --- a/ld/emultempl/alphaelf.em +++ b/ld/emultempl/alphaelf.em @@ -80,7 +80,7 @@ alpha_after_parse (void) exp_nameop (SIZEOF_HEADERS, NULL)), NULL); - after_parse_default (); + gld${EMULATION_NAME}_after_parse (); } static void diff --git a/ld/emultempl/cr16elf.em b/ld/emultempl/cr16elf.em index f76b95e2dfe..0cf5e39840a 100644 --- a/ld/emultempl/cr16elf.em +++ b/ld/emultempl/cr16elf.em @@ -119,7 +119,7 @@ cr16elf_after_parse (void) is true the link sometimes fails. */ config.magic_demand_paged = FALSE; - after_parse_default (); + gld${EMULATION_NAME}_after_parse (); } /* This is called after the sections have been attached to output diff --git a/ld/emultempl/crxelf.em b/ld/emultempl/crxelf.em index c6d5a8dd646..ae12f5ed450 100644 --- a/ld/emultempl/crxelf.em +++ b/ld/emultempl/crxelf.em @@ -43,7 +43,7 @@ crxelf_after_parse (void) is true the link sometimes fails. */ config.magic_demand_paged = FALSE; - after_parse_default (); + gld${EMULATION_NAME}_after_parse (); } /* This is called after the sections have been attached to output diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 13a1a414fb0..482e9ca918d 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -63,6 +63,7 @@ fragment < + + PR ld/15096 + * ld-elf/new-dtags-1.d: New test. + * ld-elf/new-dtags-2.d: Likewise. + * ld-elf/new-dtags-3.d: Likewise. + * ld-elf/new-dtags-4.d: Likewise. + * ld-elf/new-dtags-5.d: Likewise. + * ld-elf/new-dtags-6.d: Likewise. + * ld-elf/new-dtags-7.d: Likewise. + * ld-elf/new-dtags-8.d: Likewise. + 2013-01-31 Alan Modra * ld-powerpc/tlsexe.d: Update for changed stub names. diff --git a/ld/testsuite/ld-elf/new-dtags-1.d b/ld/testsuite/ld-elf/new-dtags-1.d new file mode 100644 index 00000000000..918a326f04d --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-1.d @@ -0,0 +1,9 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -rpath . +#target: *-*-linux* *-*-gnu* + +#failif +#... + +0x[0-9a-f]+ +\(RUNPATH\) +Library runpath: +\[.\] +#... diff --git a/ld/testsuite/ld-elf/new-dtags-2.d b/ld/testsuite/ld-elf/new-dtags-2.d new file mode 100644 index 00000000000..17be86d1462 --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-2.d @@ -0,0 +1,8 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -rpath . +#target: *-*-linux* *-*-gnu* + +#... + +0x[0-9a-f]+ +\(RPATH\) +Library rpath: +\[.\] +#pass diff --git a/ld/testsuite/ld-elf/new-dtags-3.d b/ld/testsuite/ld-elf/new-dtags-3.d new file mode 100644 index 00000000000..4d06639f837 --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-3.d @@ -0,0 +1,9 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -rpath . --enable-new-dtags +#target: *-*-linux* *-*-gnu* + +#failif +#... + +0x[0-9a-f]+ +\(RPATH\) +Library rpath: +\[.\] +#... diff --git a/ld/testsuite/ld-elf/new-dtags-4.d b/ld/testsuite/ld-elf/new-dtags-4.d new file mode 100644 index 00000000000..0df8af62eae --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-4.d @@ -0,0 +1,8 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -rpath . --enable-new-dtags +#target: *-*-linux* *-*-gnu* + +#... + +0x[0-9a-f]+ +\(RUNPATH\) +Library runpath: +\[.\] +#pass diff --git a/ld/testsuite/ld-elf/new-dtags-5.d b/ld/testsuite/ld-elf/new-dtags-5.d new file mode 100644 index 00000000000..eb1a587ca4a --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-5.d @@ -0,0 +1,9 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -z now +#target: *-*-linux* *-*-gnu* + +#failif +#... + 0x[0-9a-f]+ +\(BIND_NOW\) + +#... diff --git a/ld/testsuite/ld-elf/new-dtags-6.d b/ld/testsuite/ld-elf/new-dtags-6.d new file mode 100644 index 00000000000..e2734e733d3 --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-6.d @@ -0,0 +1,8 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -z now +#target: *-*-linux* *-*-gnu* + +#... + 0x[0-9a-f]+ +\(FLAGS\) +BIND_NOW +#pass diff --git a/ld/testsuite/ld-elf/new-dtags-7.d b/ld/testsuite/ld-elf/new-dtags-7.d new file mode 100644 index 00000000000..fa98065c621 --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-7.d @@ -0,0 +1,9 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -z now --disable-new-dtags +#target: *-*-linux* *-*-gnu* + +#failif +#... + 0x[0-9a-f]+ +\(FLAGS\) +BIND_NOW +#pass diff --git a/ld/testsuite/ld-elf/new-dtags-8.d b/ld/testsuite/ld-elf/new-dtags-8.d new file mode 100644 index 00000000000..421063d9386 --- /dev/null +++ b/ld/testsuite/ld-elf/new-dtags-8.d @@ -0,0 +1,8 @@ +#source: start.s +#readelf: -d -W +#ld: -shared -z now --disable-new-dtags +#target: *-*-linux* *-*-gnu* + +#... + 0x[0-9a-f]+ +\(BIND_NOW\) + +#pass