This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/17078] New: error while loading shared libraries: unexpected reloc type 0x0d


https://sourceware.org/bugzilla/show_bug.cgi?id=17078

            Bug ID: 17078
           Summary: error while loading shared libraries: unexpected reloc
                    type 0x0d
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: macro@linux-mips.org
                CC: macro@linux-mips.org
            Target: arm-linux-gnueabi

All the TLS test cases fail in the prelinker test suite when built with
the use of R_ARM_TLS_DESC relocations, that is with the
`-mtls-dialect=gnu2' GCC option in effect.  The following messages are
produced:

./tls1: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls1.sh
./tls2: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls2.sh
./tls3: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls3.sh
./tls4: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls4.sh
./tls5: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls5.sh
./tls6: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls6.sh

The reason is the lack of handling for prelinked R_ARM_TLS_DESC
relocations in the dynamic linker.

Borrowing the testcase from bug #17075 it can also be reproduced as
follows:

$ cat libgetfoo.c
int __thread foo;

int
getfoo (void)
{
  return foo;
}
$ arm-linux-gnueabi-gcc -mtls-dialect=gnu2 -fPIC -shared
-Wl,-dynamic-linker,.../lib/ld-linux.so.3 -Wl,-rpath,.../lib -Wl,-rpath,$(pwd)
-o libgetfoo.so libgetfoo.c
$ cat getfoo.c
int getfoo (void);

int
main (void)
{
  return getfoo ();
}
$ arm-linux-gnueabi-gcc -mtls-dialect=gnu2
-Wl,-dynamic-linker,.../lib/ld-linux.so.3 -Wl,-rpath,.../lib -Wl,-rpath,$(pwd)
-o getfoo -L. -lgetfoo getfoo.c
$ ssh arm-host $(pwd)/getfoo
$ echo $?
0
$ echo .../lib > prelink.conf
$ echo $(pwd) >> prelink.conf
$ arm-linux-gnueabi-prelink -c ./prelink.conf -C ./prelink.cache
--ld-library-path=.../lib:$(pwd) --dynamic-linker=.../lib/ld-linux.so.3 -v
getfoo
Laying out 4 libraries in virtual address space 41000000-50000000
Assigned virtual address space slots for libraries:
.../lib/ld-linux.so.3 41000000-41028954
.../lib/libc.so.6 41030000-4116d588
.../lib/libgcc_s.so.1 41170000-4119832c
$(pwd)/libgetfoo.so 411a0000-411a8910
Prelinking .../lib/ld-2.19.90.so
Prelinking .../lib/libc-2.19.90.so
Prelinking .../lib/libgcc_s.so.1
Prelinking $(pwd)/libgetfoo.so
Prelinking $(pwd)/getfoo
$ ssh arm-host $(pwd)/getfoo
$(pwd)/getfoo: error while loading shared libraries: unexpected reloc type 0x0d
$ echo $?
127
$ 

I have substituted `...' for the sysroot path and $(pwd) for the CWD even
in output to avoid clutter.

The ARM TLS descriptor specification can be referred at bug #17075.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]