Skip to content

llvm-strip.exe error: unexpected associative section index #53433

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

Open
encelo opened this issue Jan 27, 2022 · 6 comments
Open

llvm-strip.exe error: unexpected associative section index #53433

encelo opened this issue Jan 27, 2022 · 6 comments

Comments

@encelo
Copy link

encelo commented Jan 27, 2022

I'm the developer of nCine, a cross-platform 2D game framework that is constantly built by GitHub Actions using different compilers, on different platforms.

Since some months there is a combination in the test matrix that it consistently failing: when I compile my project on MSYS2 using clang then I have a strange issue with llvm-strip.

The error message is: C:\msys64\mingw64\bin/llvm-strip.exe: error: 'D:/a/nCine/nCine-build-DevDist/libncine.dll': unexpected associative section index. Basically my library cannot be stripped for some reason and this was not happening some months ago.

I can reproduce the issue on my machine with MSYS2 installed and Clang 13, it is not a GitHub Actions runner only issue.

@llvmbot
Copy link
Member

llvmbot commented Jan 27, 2022

@llvm/issue-subscribers-tools-llvm-objcopy-strip

@belmeopmenieuwesim
Copy link

belmeopmenieuwesim commented May 6, 2022

This is still an issue today. Even on LLVM version 14.0

@belmeopmenieuwesim
Copy link

belmeopmenieuwesim commented May 7, 2022

I found something that may be of value. It appears that this error is triggered when PointerToSymbolTable is set in the PE IMAGE_FILE_HEADER. If this is zeroed out, then llvm-strip will work fine. Hope this helps...

A temporary fix would be also to compile with the linker flag --discard-all, since it will avoid populating PointerToSymbolTable.

@MaskRay maybe you know a way to solve this in llvm-strip?

@loumalouomega
Copy link

Any new about this issue?, I would try the --discard-all workaround

@jh7370
Copy link
Collaborator

jh7370 commented Jan 27, 2025

@mstorsjo, this is outside my realm of expertise. Could you take a look?

@mstorsjo
Copy link
Member

I found something that may be of value. It appears that this error is triggered when PointerToSymbolTable is set in the PE IMAGE_FILE_HEADER. If this is zeroed out, then llvm-strip will work fine. Hope this helps...

I can successfully strip binaries with PointerToSymbolTable (that's the default for of binaries linked in mingw mode, where this tool is used a lot), so there has to be something else to it as well.

Please provide a sample input file where this issue reproduces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants