Search
j0ke.net Open Build Service
>
Projects
>
devel
>
binutils
> s390-pic-dso.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File s390-pic-dso.diff of Package binutils
--- ./ld/testsuite/ld-shared/shared.exp.mm 2005-06-22 20:53:35.000000000 +0000 +++ ./ld/testsuite/ld-shared/shared.exp 2006-02-06 16:54:00.000000000 +0000 @@ -208,7 +208,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ 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 @@ -228,7 +228,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ 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" @@ -277,7 +277,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $p 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 { --- ./ld/testsuite/ld-elfvsb/elfvsb.exp.mm 2005-06-22 20:53:35.000000000 +0000 +++ ./ld/testsuite/ld-elfvsb/elfvsb.exp 2006-02-06 16:51:40.000000000 +0000 @@ -265,6 +265,7 @@ proc visibility_run {visibility} { setup_xfail "sparc*-*-linux*" } } + setup_xfail "s390*-*-linux*" setup_xfail "x86_64-*-linux*" if { ![istarget hppa*64*-*-linux*] } { setup_xfail "hppa*-*-linux*" @@ -303,6 +304,7 @@ proc visibility_run {visibility} { 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*" @@ -369,6 +371,7 @@ proc visibility_run {visibility} { setup_xfail "sparc*-*-linux*" } } + setup_xfail "s390*-*-linux*" setup_xfail "x86_64-*-linux*" if { ![istarget hppa*64*-*-linux*] } { setup_xfail "hppa*-*-linux*" --- ./bfd/elf32-s390.c.mm 2005-11-13 17:16:34.000000000 +0000 +++ ./bfd/elf32-s390.c 2006-02-06 16:56:02.000000000 +0000 @@ -2545,13 +2545,30 @@ elf_s390_relocate_section (output_bfd, i 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: + /* This is strictly required only for PC32DLB, which + 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 + && (input_section->flags & SEC_READONLY) != 0) + { + (*_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: /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by a linker script. */ --- bfd/elf64-s390.c.mm +++ bfd/elf64-s390.c @@ -2522,15 +2522,32 @@ 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: + /* This is strictly required only for PC32DLB, which + 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 + && (input_section->flags & SEC_READONLY) != 0) + { + (*_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: /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by a linker script. */ --- ./ld/testsuite/ld-elfvers/vers.exp.mm 2006-02-06 17:13:27.000000000 +0000 +++ ./ld/testsuite/ld-elfvers/vers.exp 2006-02-06 17:37:33.000000000 +0000 @@ -94,6 +94,7 @@ if [istarget mips*-*-*] { case $target_triplet in { { ia64-*-* } { set as_options "-x" } + { s390-*-linux-* } { set as_options "-march=z900" } default { set as_options "" } } @@ -775,8 +776,9 @@ proc build_exec { test source execname f pass $test } -if [istarget x86_64-*-linux*] { - # x86_64 doesn't like non-pic shared libraries +if { [istarget x86_64-*-linux*] \ + || [istarget s390*-*-linux*] } { + # x86_64 and s390 doesn't like non-pic shared libraries set pic "yes" } else { set pic "no"