Issue 134558
Summary [LLD] MinGW driver __image_base__ alternate name wrongly defined on i386
Labels lld
Assignees
Reporter jeremyd2019
    in lld/MinGW/Driver.cpp, there is:
https://github.com/llvm/llvm-project/blob/eb70253fcbe57c7cb3c309c06b94b05f2eab314d/lld/MinGW/Driver.cpp#L524-L527

This does not seem to work in the default case:
```console
$ g++ hello.cc -fuse-ld=lld
warning: failed to compute relocation: IMAGE_REL_I386_REL32, Invalid data was encountered while parsing the file
ld.lld: error: undefined symbol: __image_base__
>>> referenced by /t/r/msys2-runtime-3.3/src/msys2-runtime/winsup/cygwin/lib/_cygwin_crt0_common.cc:188
>>> libmsys-2.0.a(_cygwin_crt0_common.o):(.text)
collect2: error: ld returned 1 exit status
```

As a workaround I can do:
```console
$ g++ hello.cc -fuse-ld=lld -Wl,-m,i386pe

$ ./a.exe
Hello
```

@mstorsjo @mati865
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to