Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binutils: relocation truncated to fit: IMAGE_REL_ARM64_ADDR32 against symbol when linking against DLL creted by link.exe #235

Open
Blackhex opened this issue Jan 2, 2025 · 0 comments

Comments

@Blackhex
Copy link
Member

Blackhex commented Jan 2, 2025

DLL produced by link.exe from Visual Studio Build Tools is linked with GCC produced application using ld linker from `binutils. The following error occurs:

aarch64-w64-mingw32-gcc reloc-use-dll-gcc.o -lreloc-dll-msvc -L. -o reloc-gcc-msvc.exe
./reloc-dll-msvc.lib(reloc-dll-msvc.dll):(.text+0x0): relocation truncated to fit: IMAGE_REL_ARM64_ADDR32 against symbol `__imp_test_reloc' defined in .idata$5 section in ./reloc-dll-msvc.lib(reloc-dll-msvc.dll)
collect2: error: ld returned 1 exit status

When the DLL is created using GCC (calling ld as a linker) from objects created by MSVC cl.exe this issue does not occur.

See the reloc.zip for the detailed repro-case.

@Blackhex Blackhex changed the title relocation truncated to fit: IMAGE_REL_ARM64_ADDR32 against symbol when linking against DLL creted by link.exe Binutils: relocation truncated to fit: IMAGE_REL_ARM64_ADDR32 against symbol when linking against DLL creted by link.exe Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant