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

Error defining multiple symbols with the same name in different files #369

Open
weirdbeardgame opened this issue May 12, 2024 · 4 comments

Comments

@weirdbeardgame
Copy link

When trying to fill in symbol_addrs.txt I have multiple of the same symbol that exist in different files across my project
IE. https://github.com/weirdbeardgame/Fatal-Frame-2/blob/0867e03af6df3f48db396d2826c27eea63c1c1cd/symbol_addrs.txt#L3

Splat will throw an error that symbol already exists Duplicate symbol detected! _fixed_array_verifyrange__H1ZPv_UiUi_PX01 has already been defined at vram 0x0011CF10

Is there some way we can specify what file or scope this exists in?

@ethteck
Copy link
Owner

ethteck commented May 12, 2024

Are you referring to files other than the main elf? each file you are disassembling with splat should have its own symbol_addrs file

@AngheloAlf
Copy link
Collaborator

The disassembly generated by splat is always globally visible. There's no concept of file scope, specially because the generated disassembly does not respect the original TUs but instead they disassemble each section of a TU separately.

If you really want to have duplicated symbol names on your symbol_addrs file then you can use the allow_duplicated attribute, but it isn't really recommended because you will get linker errors because of duplicated global symbols. This attribute is only useful for symbols that have been already migrated to C but splat still needs to know about them to reference them properly (like in extracted assets)

@weirdbeardgame
Copy link
Author

weirdbeardgame commented May 12, 2024

Are you referring to files other than the main elf? each file you are disassembling with Splat should have its own symbol_addrs file

I mean across the main file. IE, in different header or C, CPP files. It's an effect of them using a generic template or type T and the compiler obviously making multiple implementations for the same thing repeatedly.

@ethteck
Copy link
Owner

ethteck commented May 12, 2024

Ah okay, Idk anything about c++ template codegen

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

3 participants