mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
Add $PLT_CFLAGS to -fPIC for run_cc_link_tests
Some x86 linker tests expect PLT. This patch adds $PLT_CFLAGS to -fPIC for run_cc_link_tests. * ld-i386/i386.exp (run_cc_link_tests): Add $PLT_CFLAGS to -fPIC if needed. * ld-x86-64/mpx.exp (run_cc_link_tests): Likewise. * ld-x86-64/x86-64.exp (run_cc_link_tests): Likewise.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* ld-i386/i386.exp (run_cc_link_tests): Add $PLT_CFLAGS to
|
||||||
|
-fPIC if needed.
|
||||||
|
* ld-x86-64/mpx.exp (run_cc_link_tests): Likewise.
|
||||||
|
* ld-x86-64/x86-64.exp (run_cc_link_tests): Likewise.
|
||||||
|
|
||||||
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
|
2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* ld-elfvsb/elfvsb.exp (visibility_run): Pass $PLT_CFLAGS to
|
* ld-elfvsb/elfvsb.exp (visibility_run): Pass $PLT_CFLAGS to
|
||||||
|
@ -310,6 +310,9 @@ run_dump_test "pr17057"
|
|||||||
run_dump_test "pr17935-1"
|
run_dump_test "pr17935-1"
|
||||||
run_dump_test "pr17935-2"
|
run_dump_test "pr17935-2"
|
||||||
|
|
||||||
|
# Add $PLT_CFLAGS if PLT is expected.
|
||||||
|
global PLT_CFLAGS
|
||||||
|
|
||||||
# Must be Linux native with the C compiler
|
# Must be Linux native with the C compiler
|
||||||
if { [isnative]
|
if { [isnative]
|
||||||
&& [istarget "i?86-*-linux*"]
|
&& [istarget "i?86-*-linux*"]
|
||||||
@ -342,7 +345,7 @@ if { [isnative]
|
|||||||
[list \
|
[list \
|
||||||
"Build libplt-main3.a" \
|
"Build libplt-main3.a" \
|
||||||
"" \
|
"" \
|
||||||
"-fPIC" \
|
"-fPIC $PLT_CFLAGS" \
|
||||||
{ plt-main3.c } \
|
{ plt-main3.c } \
|
||||||
{{readelf {-Wr} plt-main3.rd}} \
|
{{readelf {-Wr} plt-main3.rd}} \
|
||||||
"libplt-main3.a" \
|
"libplt-main3.a" \
|
||||||
@ -350,7 +353,7 @@ if { [isnative]
|
|||||||
[list \
|
[list \
|
||||||
"Build libplt-main4.a" \
|
"Build libplt-main4.a" \
|
||||||
"" \
|
"" \
|
||||||
"-fPIC" \
|
"-fPIC $PLT_CFLAGS" \
|
||||||
{ plt-main4.c } \
|
{ plt-main4.c } \
|
||||||
{{readelf {-Wr} plt-main4.rd}} \
|
{{readelf {-Wr} plt-main4.rd}} \
|
||||||
"libplt-main4.a" \
|
"libplt-main4.a" \
|
||||||
|
@ -36,28 +36,59 @@ if { [which $CC] == 0 } {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
set build_tests {
|
# Add $PLT_CFLAGS if PLT is expected.
|
||||||
{"Build libmpx1a.a"
|
global PLT_CFLAGS
|
||||||
"" "-Wa,-madd-bnd-prefix -fPIC"
|
|
||||||
{mpx1a.c} {{readelf {-r --wide} mpx1a.rd}} "libmpx1a.a"}
|
|
||||||
{"Build libmpx1b.a"
|
|
||||||
"" ""
|
|
||||||
{mpx1b.c} {} "libmpx1b.a"}
|
|
||||||
{"Build libmpx1c.a"
|
|
||||||
"" "-Wa,-madd-bnd-prefix"
|
|
||||||
{mpx1c.c} {{readelf {-r --wide} mpx1c.rd}} "libmpx1c.a"}
|
|
||||||
{"Build libmpx2a.a"
|
|
||||||
"" "-Wa,-madd-bnd-prefix -fPIE"
|
|
||||||
{mpx2a.c} {{readelf {-r --wide} mpx2a.rd}} "libmpx2a.a"}
|
|
||||||
{"Build libmpx2b.a"
|
|
||||||
"" "-fPIE"
|
|
||||||
{mpx2b.c} {} "libmpx2b.a"}
|
|
||||||
{"Build libmpx2c.a"
|
|
||||||
"" "-Wa,-madd-bnd-prefix -fPIE"
|
|
||||||
{mpx2c.c} {{readelf {-r --wide} mpx2c.rd}} "libmpx2c.a"}
|
|
||||||
}
|
|
||||||
|
|
||||||
run_cc_link_tests $build_tests
|
run_cc_link_tests [list \
|
||||||
|
[list \
|
||||||
|
"Build libmpx1a.a" \
|
||||||
|
"" \
|
||||||
|
"-Wa,-madd-bnd-prefix -fPIC $PLT_CFLAGS" \
|
||||||
|
{mpx1a.c} \
|
||||||
|
{{readelf {-r --wide} mpx1a.rd}} \
|
||||||
|
"libmpx1a.a" \
|
||||||
|
] \
|
||||||
|
[list \
|
||||||
|
"Build libmpx1b.a" \
|
||||||
|
"" \
|
||||||
|
"" \
|
||||||
|
{mpx1b.c} \
|
||||||
|
{} \
|
||||||
|
"libmpx1b.a" \
|
||||||
|
] \
|
||||||
|
[list \
|
||||||
|
"Build libmpx1c.a" \
|
||||||
|
"" \
|
||||||
|
"-Wa,-madd-bnd-prefix" \
|
||||||
|
{mpx1c.c} \
|
||||||
|
{{readelf {-r --wide} mpx1c.rd}} \
|
||||||
|
"libmpx1c.a" \
|
||||||
|
] \
|
||||||
|
[list \
|
||||||
|
"Build libmpx2a.a" \
|
||||||
|
"" \
|
||||||
|
"-Wa,-madd-bnd-prefix -fPIE $PLT_CFLAGS" \
|
||||||
|
{mpx2a.c} \
|
||||||
|
{{readelf {-r --wide} mpx2a.rd}} \
|
||||||
|
"libmpx2a.a" \
|
||||||
|
] \
|
||||||
|
[list \
|
||||||
|
"Build libmpx2b.a" \
|
||||||
|
"" \
|
||||||
|
"-fPIE" \
|
||||||
|
{mpx2b.c} \
|
||||||
|
{} \
|
||||||
|
"libmpx2b.a" \
|
||||||
|
] \
|
||||||
|
[list \
|
||||||
|
"Build libmpx2c.a" \
|
||||||
|
"" \
|
||||||
|
"-Wa,-madd-bnd-prefix -fPIE $PLT_CFLAGS" \
|
||||||
|
{mpx2c.c} \
|
||||||
|
{{readelf {-r --wide} mpx2c.rd}} \
|
||||||
|
"libmpx2c.a" \
|
||||||
|
] \
|
||||||
|
]
|
||||||
|
|
||||||
set run_tests {
|
set run_tests {
|
||||||
{"Run mpx1"
|
{"Run mpx1"
|
||||||
|
@ -326,6 +326,9 @@ run_dump_test "pr17935-2"
|
|||||||
run_dump_test "pr18160"
|
run_dump_test "pr18160"
|
||||||
run_dump_test "pr18176"
|
run_dump_test "pr18176"
|
||||||
|
|
||||||
|
# Add $PLT_CFLAGS if PLT is expected.
|
||||||
|
global PLT_CFLAGS
|
||||||
|
|
||||||
# Must be native with the C compiler
|
# Must be native with the C compiler
|
||||||
if { [isnative] && [which $CC] != 0 } {
|
if { [isnative] && [which $CC] != 0 } {
|
||||||
run_cc_link_tests {
|
run_cc_link_tests {
|
||||||
@ -376,7 +379,7 @@ if { [isnative] && [which $CC] != 0 } {
|
|||||||
[list \
|
[list \
|
||||||
"Build libplt-main3.a" \
|
"Build libplt-main3.a" \
|
||||||
"" \
|
"" \
|
||||||
"-fPIC" \
|
"-fPIC $PLT_CFLAGS" \
|
||||||
{ plt-main3.c } \
|
{ plt-main3.c } \
|
||||||
{{readelf {-Wr} plt-main3.rd}} \
|
{{readelf {-Wr} plt-main3.rd}} \
|
||||||
"libplt-main3.a" \
|
"libplt-main3.a" \
|
||||||
@ -384,7 +387,7 @@ if { [isnative] && [which $CC] != 0 } {
|
|||||||
[list \
|
[list \
|
||||||
"Build libplt-main4.a" \
|
"Build libplt-main4.a" \
|
||||||
"" \
|
"" \
|
||||||
"-fPIC" \
|
"-fPIC $PLT_CFLAGS" \
|
||||||
{ plt-main4.c } \
|
{ plt-main4.c } \
|
||||||
{{readelf {-Wr} plt-main4.rd}} \
|
{{readelf {-Wr} plt-main4.rd}} \
|
||||||
"libplt-main4.a" \
|
"libplt-main4.a" \
|
||||||
|
Reference in New Issue
Block a user