Comments (5)
This issue does not occur on the normal GCC compiler.
from splat.
thanks for the report @weirdbeardgame - can you link a repro branch?
from splat.
https://github.com/weirdbeardgame/Fatal-Frame-2 - Uncomment Gphase.c and the file right below it then try and run it
from splat.
This behavior is expected due to how the INCLUDE_ASM
macro is defined.
What is happening is both your INCLUDE_ASM
macro and the function asm file are defining the same symbol (InitGPhaseSys__Fv
in this case) by the "\t.globl\t" #NAME "\n"
and the glabel InitGPhaseSys__Fv
respectively.
The processed asm ends up looking something like this:
.section .text
.align 3
.globl InitGPhaseSys__Fv
.ent InitGPhaseSys__Fv
InitGPhaseSys__Fv:
.set noreorder
.set noat
.align 3
glabel InitGPhaseSys__Fv
/* B09A8 001AF9A8 F0FFBD27 */ addiu $29, $29, -0x10
# ...
Notice how the symbol is defined twice. This usually doesn't matter, because in normal circumstances there's nothing that may change the alignment of the symbol between the first and second declaration, but here there's an alignment directive that (in the eyes of the assembler) may change the address of the symbol, then the assembler decides to bark at you.
You can rewrite the INCLUDE_ASM
macro to something like this to fix it:
#define INCLUDE_ASM(FOLDER, NAME) \
__asm__( \
".section .text\n" \
" .set noat\n" \
" .set noreorder\n" \
" .include \""FOLDER"/"#NAME".s\"\n" \
" .set reorder\n" \
" .set at\n" \
" .globl " #NAME ".NON_MATCHING\n" \
" " #NAME ".NON_MATCHING" " = " #NAME "\n" \
)
The important part is the macro is not defining the symbol again, it is letting the asm file to do that instead.
I know it works because that macro is what I'm using at hit_and_run
btw, why is your INCLUDE_ASM
macro so cursed? why do you even need something like INCLUDE_ASM_INTERNAL
?
from splat.
That seemed to fix this issue. Thanks!
from splat.
Related Issues (20)
- Add a pad segment HOT 3
- create_config.py needs improving for PSX
- Librarify
- splat should be lazier in its segment loading
- Doesn't create a config yml for ps2 title HOT 5
- Make linker entries less janky for .data (e.g. images) HOT 2
- Support for `.lit4` section on PS2 HOT 1
- Raise error if segment order doesn't match section_order
- Splat generates negative BSS segment start address HOT 4
- C++ Unable to declare functions in Header HOT 4
- Error defining multiple symbols with the same name in different files HOT 4
- Error creating config to baserom HOT 2
- Option for generating linker script that forces matching object section addresses? HOT 6
- gzip support HOT 3
- Allow setting a different alignment for each section HOT 4
- PS1: support SPE and improperly sanitized PS-X executables
- Feature Request: Add option to avoid generating template function implementations in files HOT 1
- `ld_align_segment_start` does not work properly when used together with `follows_vram`
- EE Core `pmfhl` instruction variants not recognized HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from splat.