2009-11-27 12:33:30 +01:00
|
|
|
Index: bfd/elf32-s390.c
|
|
|
|
===================================================================
|
|
|
|
--- bfd/elf32-s390.c.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ bfd/elf32-s390.c 2009-11-23 14:03:09.000000000 +0100
|
|
|
|
@@ -2509,13 +2509,34 @@ elf_s390_relocate_section (output_bfd, i
|
2007-10-09 04:28:58 +02:00
|
|
|
unresolved_reloc = FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
- case R_390_8:
|
|
|
|
- case R_390_16:
|
|
|
|
- case R_390_32:
|
|
|
|
case R_390_PC16:
|
|
|
|
case R_390_PC16DBL:
|
|
|
|
case R_390_PC32DBL:
|
|
|
|
case R_390_PC32:
|
2008-02-16 03:58:48 +01:00
|
|
|
+ /* This is strictly required only for PC32DBL, which
|
2007-10-09 04:28:58 +02:00
|
|
|
+ is not handled by ld.so, but let's be helpful to the user also
|
|
|
|
+ in the other cases. */
|
|
|
|
+ if (info->shared
|
|
|
|
+ && !SYMBOL_REFERENCES_LOCAL (info, h)
|
|
|
|
+ && (input_section->flags & SEC_ALLOC) != 0
|
2008-02-16 03:58:48 +01:00
|
|
|
+ && (input_section->flags & SEC_READONLY) != 0
|
|
|
|
+ && (!h->def_regular
|
|
|
|
+ || r_type != R_390_PC32DBL
|
|
|
|
+ || h->type != STT_FUNC
|
|
|
|
+ || ELF_ST_VISIBILITY (h->other) != STV_PROTECTED))
|
2007-10-09 04:28:58 +02:00
|
|
|
+ {
|
|
|
|
+ (*_bfd_error_handler)
|
|
|
|
+ (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
|
|
|
|
+ input_bfd, elf_howto_table[r_type].name,
|
|
|
|
+ h->root.root.string);
|
|
|
|
+ bfd_set_error (bfd_error_bad_value);
|
|
|
|
+ return FALSE;
|
|
|
|
+ }
|
|
|
|
+ /* Fall through. */
|
|
|
|
+
|
|
|
|
+ case R_390_8:
|
|
|
|
+ case R_390_16:
|
|
|
|
+ case R_390_32:
|
|
|
|
if ((input_section->flags & SEC_ALLOC) == 0)
|
|
|
|
break;
|
|
|
|
|
2009-11-27 12:33:30 +01:00
|
|
|
Index: bfd/elf64-s390.c
|
|
|
|
===================================================================
|
|
|
|
--- bfd/elf64-s390.c.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ bfd/elf64-s390.c 2009-11-23 14:03:09.000000000 +0100
|
|
|
|
@@ -2486,15 +2486,36 @@ elf_s390_relocate_section (output_bfd, i
|
2007-10-09 04:28:58 +02:00
|
|
|
unresolved_reloc = FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
- case R_390_8:
|
|
|
|
- case R_390_16:
|
|
|
|
- case R_390_32:
|
|
|
|
- case R_390_64:
|
|
|
|
case R_390_PC16:
|
|
|
|
case R_390_PC16DBL:
|
|
|
|
case R_390_PC32:
|
|
|
|
case R_390_PC32DBL:
|
|
|
|
case R_390_PC64:
|
2008-02-16 03:58:48 +01:00
|
|
|
+ /* This is strictly required only for PC32DBL, which
|
2007-10-09 04:28:58 +02:00
|
|
|
+ is not handled by ld.so, but let's be helpful to the user also
|
|
|
|
+ in the other cases. */
|
|
|
|
+ if (info->shared
|
|
|
|
+ && !SYMBOL_REFERENCES_LOCAL (info, h)
|
|
|
|
+ && (input_section->flags & SEC_ALLOC) != 0
|
2008-02-16 03:58:48 +01:00
|
|
|
+ && (input_section->flags & SEC_READONLY) != 0
|
|
|
|
+ && (!h->def_regular
|
|
|
|
+ || r_type != R_390_PC32DBL
|
|
|
|
+ || h->type != STT_FUNC
|
|
|
|
+ || ELF_ST_VISIBILITY (h->other) != STV_PROTECTED))
|
2007-10-09 04:28:58 +02:00
|
|
|
+ {
|
|
|
|
+ (*_bfd_error_handler)
|
|
|
|
+ (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
|
|
|
|
+ input_bfd, elf_howto_table[r_type].name,
|
|
|
|
+ h->root.root.string);
|
|
|
|
+ bfd_set_error (bfd_error_bad_value);
|
|
|
|
+ return FALSE;
|
|
|
|
+ }
|
|
|
|
+ /* Fall through. */
|
|
|
|
+
|
|
|
|
+ case R_390_8:
|
|
|
|
+ case R_390_16:
|
|
|
|
+ case R_390_32:
|
|
|
|
+ case R_390_64:
|
|
|
|
if ((input_section->flags & SEC_ALLOC) == 0)
|
|
|
|
break;
|
|
|
|
|
2009-11-27 12:33:30 +01:00
|
|
|
Index: ld/testsuite/ld-elfvers/vers.exp
|
|
|
|
===================================================================
|
|
|
|
--- ld/testsuite/ld-elfvers/vers.exp.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ ld/testsuite/ld-elfvers/vers.exp 2009-11-23 14:03:09.000000000 +0100
|
2008-02-16 03:58:48 +01:00
|
|
|
@@ -97,6 +97,7 @@ if [istarget mips*-*-*] {
|
2007-10-09 04:28:58 +02:00
|
|
|
|
|
|
|
case $target_triplet in {
|
|
|
|
{ ia64-*-* } { set as_options "-x" }
|
|
|
|
+ { s390-*-linux-* } { set as_options "-march=z900" }
|
|
|
|
default { set as_options "" }
|
|
|
|
}
|
|
|
|
|
2008-02-16 03:58:48 +01:00
|
|
|
@@ -767,8 +768,9 @@ proc build_exec { test source execname f
|
2007-10-09 04:28:58 +02:00
|
|
|
pass $test
|
|
|
|
}
|
|
|
|
|
|
|
|
-if [istarget x86_64-*-linux*] {
|
|
|
|
- # x86_64 doesn't like non-pic shared libraries
|
|
|
|
+if { [istarget x86_64-*-linux*] \
|
|
|
|
+ || [istarget s390*-*-linux*] } {
|
2008-02-16 03:58:48 +01:00
|
|
|
+ # x86_64 and s390 don't like non-pic shared libraries
|
2007-10-09 04:28:58 +02:00
|
|
|
set pic "yes"
|
|
|
|
} else {
|
|
|
|
set pic "no"
|
2009-11-27 12:33:30 +01:00
|
|
|
Index: ld/testsuite/ld-elfvsb/elfvsb.exp
|
|
|
|
===================================================================
|
|
|
|
--- ld/testsuite/ld-elfvsb/elfvsb.exp.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ ld/testsuite/ld-elfvsb/elfvsb.exp 2009-11-23 14:03:09.000000000 +0100
|
|
|
|
@@ -269,6 +269,7 @@ proc visibility_run {visibility} {
|
2007-10-09 04:28:58 +02:00
|
|
|
setup_xfail "sparc*-*-linux*"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ setup_xfail "s390*-*-linux*"
|
|
|
|
setup_xfail "x86_64-*-linux*"
|
|
|
|
if { ![istarget hppa*64*-*-linux*] } {
|
|
|
|
setup_xfail "hppa*-*-linux*"
|
2009-11-27 12:33:30 +01:00
|
|
|
@@ -307,6 +308,7 @@ proc visibility_run {visibility} {
|
2007-10-09 04:28:58 +02:00
|
|
|
setup_xfail "alpha*-*-linux*"
|
|
|
|
setup_xfail "mips*-*-linux*"
|
|
|
|
}
|
|
|
|
+ setup_xfail "s390*-*-linux*"
|
|
|
|
setup_xfail "x86_64-*-linux*"
|
|
|
|
if { ![istarget hppa*64*-*-linux*] } {
|
|
|
|
setup_xfail "hppa*-*-linux*"
|
2009-11-27 12:33:30 +01:00
|
|
|
@@ -373,6 +375,7 @@ proc visibility_run {visibility} {
|
2007-10-09 04:28:58 +02:00
|
|
|
setup_xfail "sparc*-*-linux*"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ setup_xfail "s390*-*-linux*"
|
|
|
|
setup_xfail "x86_64-*-linux*"
|
|
|
|
if { ![istarget hppa*64*-*-linux*] } {
|
|
|
|
setup_xfail "hppa*-*-linux*"
|
2009-11-27 12:33:30 +01:00
|
|
|
Index: ld/testsuite/ld-shared/shared.exp
|
|
|
|
===================================================================
|
|
|
|
--- ld/testsuite/ld-shared/shared.exp.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ ld/testsuite/ld-shared/shared.exp 2009-11-23 14:03:09.000000000 +0100
|
2008-02-16 03:58:48 +01:00
|
|
|
@@ -211,7 +211,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $
|
2007-10-09 04:28:58 +02:00
|
|
|
setup_xfail "sparc*-*-linux*"
|
|
|
|
}
|
|
|
|
setup_xfail "x86_64-*-linux*"
|
|
|
|
- setup_xfail "s390x-*-linux*"
|
|
|
|
+ setup_xfail "s390*-*-linux*"
|
|
|
|
shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared
|
|
|
|
|
|
|
|
# Test ELF shared library relocations with a non-zero load
|
2008-02-16 03:58:48 +01:00
|
|
|
@@ -231,7 +231,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $
|
2007-10-09 04:28:58 +02:00
|
|
|
setup_xfail "sparc*-*-linux*"
|
|
|
|
}
|
|
|
|
setup_xfail "x86_64-*-linux*"
|
|
|
|
- setup_xfail "s390x-*-linux*"
|
|
|
|
+ setup_xfail "s390*-*-linux*"
|
|
|
|
shared_test shnp "shared (non PIC, load offset)" \
|
|
|
|
mainnp.o sh1np.o sh2np.o shared \
|
|
|
|
"-T $srcdir/$subdir/elf-offset.ld"
|
2008-02-16 03:58:48 +01:00
|
|
|
@@ -280,7 +280,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $p
|
2007-10-09 04:28:58 +02:00
|
|
|
setup_xfail "sparc*-*-linux*"
|
|
|
|
}
|
|
|
|
setup_xfail "x86_64-*-linux*"
|
|
|
|
- setup_xfail "s390x-*-linux*"
|
|
|
|
+ setup_xfail "s390*-*-linux*"
|
|
|
|
shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared
|
|
|
|
}
|
|
|
|
} else {
|