- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When using ICX to link .asm files with /Zi, all the filenames are embedded into binary in plain-text.
Given a simple project:
- Main.asm
- Test.asm
I link them as follows:
icx *.asm -Zi
It produces a binary, "Main.exe". But at the end of the binary, the original filenames are visible in plain text.
How do I remove these filenames while still producing a working .pdb file?
Other Observations:
- This does not happen if I compile source files directly into a binary (without a separate linking step).
- If I rename all the .asm files prior to linking, the resulting .pdb file still works. Thus proving that the filenames are not needed.
- If I omit the `-Zi` flag, the filenames no longer appear. But this also disables the .pdb file which I need.
Is there there a compiler flag that will omit the filenames in the binary? Or is the only option to obfuscate the filenames prior to linking? (or perhaps post-compilation binary-modification to overwrite those filenames)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By using the Microsoft compiler cl, the file names are also in the executable (binary) file. Have you ever seen that the file names are completed omitted under any circumstances ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see it with MSVC (17.7.1). But those use .obj instead of .asm, not sure if that matters.
cl *.obj /PDB:"program.pdb" /OUT:"program.exe"
No filenames in the binary. (Not the exact flags, there are more of them.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
C:\Users\ayu1\Project14>cl /Zi main.obj test.obj
Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 14.39.33523.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
/debug
main.obj
test.obj
And when main.exe is checked:
Can you please clarify your question by supplying a reproducer and exact commands used to demonstrate your issue? And please clearly indicate that which file you'd like to omit the file names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ICX Version: 2024.1.0 Build 20240308
Main.cpp
#include <iostream>
using namespace std;
int test();
int main(){
cout << "hello world" << endl;
test();
}
Test.cpp
#include <iostream>
using namespace std;
int test(){
cout << "hello world" << endl;
return 0;
}
Compilation steps:
icx *.cpp /S
icx *.asm /Zi
The resulting "Main.exe" contains the names "Main.asm" and "Test.asm". I want both of these names omitted from the binary. In a larger proprietary project with many sensitive filenames, this will obviously leak too much IP (intellectual property).
The binary also contains the name "Main.pdb", but that's okay since it's just the name of the .pdb.
Again, this only happens with ICX on Windows. It doesn't happen with MSVC, or even ICX on Linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I understood now. I'm escalating your issue to our internal engineer team and will come back with update.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page