Skip to content

[MC] Invalid GOTOFF relocation in shared library objects #10065

@llvmbot

Description

@llvmbot
Bugzilla Link 9693
Resolution FIXED
Resolved on Aug 10, 2011 22:18
Version trunk
OS Linux
Blocks llvm/llvm-bugzilla-archive#10638
Reporter LLVM Bugzilla Contributor
CC @DimitryAndric,@efriedma-quic

Extended Description

On freenode#winehackers, Austin English reported the following while building Wine with latest trunk LLVM/Clang:

austin@aw21 ~/src/wine-clang/dlls/msvcrt $ make
../../tools/winegcc/winegcc -B../../tools/winebuild --sysroot=../.. -fasynchronous-unwind-tables -shared ./msvcrt.spec console.o cpp.o cppexcept.o ctype.o data.o dir.o environ.o errno.o except.o exit.o file.o heap.o locale.o lock.o main.o math.o mbcs.o misc.o process.o scanf.o string.o thread.o time.o undname.o wcs.o rsrc.res -o msvcrt.dll.so -ladvapi32 -luser32 -Wb,-dadvapi32 -Wb,-duser32 ../../libs/port/libwine_port.a
/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/../../../../i686-pc-linux-gnu/bin/ld: math.o: relocation R_386_GOTOFF against undefined symbol `cos@@GLIBC_2.0' can not be used when making a shared object
/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/../../../../i686-pc-linux-gnu/bin/ld: final link failed: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
winegcc: clang failed
make: *** [msvcrt.dll.so] Error 2

Looks like the ELF writer is generating GOTOFF relocations when it shouldn't be (i.e. in PIC objects).

I'll try to get him to reduce this to something you can use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions