#58571 - t81b - Mon Oct 24, 2005 5:39 pm
hello,
I've been trying to move a project over to devkitarm from devkitadv but I've run into a couple of problems with .s files.
I think I've tracked one problem down to branch commands not jumping to the correct address when I use the .global directive for a symbol.
Below is a small snippet of code demonstrating the problem.
Now this works without problems in devkitadv, but with devkitARM the branch commands point to the wrong addresses, so could there be something wrong with devkitARM or AS, or am I doing something wrong?
If I leave out the globals it works ok but I need to use them, and I could get around the problem by doing the following, so that branches within a file jump to a different label but the same address (but I'd have quite a few files to go through so I'd rather not have to do this :) )
The other problem is to do with devkitarm not being able to find .include files unless I give the absolute path such as:
rather than
I can get around this by replacing the following lines in the base_rules:
with this :
but I'd rather not go messing with the base_rules file if I can avoid it.
Any ideas on what I'm doing wrong or how to fix this?
I'm using the latest version of devkitarm.
Thanks, Brendan
I've been trying to move a project over to devkitarm from devkitadv but I've run into a couple of problems with .s files.
I think I've tracked one problem down to branch commands not jumping to the correct address when I use the .global directive for a symbol.
Below is a small snippet of code demonstrating the problem.
Code: |
.thumb_func .global back back: b for .thumb_func .global for for: b back |
Now this works without problems in devkitadv, but with devkitARM the branch commands point to the wrong addresses, so could there be something wrong with devkitARM or AS, or am I doing something wrong?
If I leave out the globals it works ok but I need to use them, and I could get around the problem by doing the following, so that branches within a file jump to a different label but the same address (but I'd have quite a few files to go through so I'd rather not have to do this :) )
Code: |
.thumb_func .global back back: back2: b for2 .thumb_func .global for for: for2: b back2 |
The other problem is to do with devkitarm not being able to find .include files unless I give the absolute path such as:
Code: |
.include "e:/project/source/hardware.inc" |
rather than
Code: |
.include "hardware.inc" |
I can get around this by replacing the following lines in the base_rules:
Code: |
#--------------------------------------------------------------------------------- %.o: %.s @echo $(notdir $<) @$(CC) -MMD -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ @$(adjustdepends) |
with this :
Code: |
#--------------------------------------------------------------------------------- %.o: %.s @echo $(notdir $<) @$(AS) $(ASFLAGS) $< -o $@ |
but I'd rather not go messing with the base_rules file if I can avoid it.
Any ideas on what I'm doing wrong or how to fix this?
I'm using the latest version of devkitarm.
Thanks, Brendan