mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2024-12-28 20:43:37 +01:00
fxconv: honor section setting for ASM conversions
This commit is contained in:
parent
c9e9f347e4
commit
dc522072e7
1 changed files with 14 additions and 14 deletions
|
@ -1186,20 +1186,6 @@ def elf(data, output, symbol, toolchain=None, arch=None, section=None,
|
|||
Produces an output file and returns nothing.
|
||||
"""
|
||||
|
||||
# Unfold ObjectData into data and assembly
|
||||
if isinstance(data, ObjectData):
|
||||
asm = ".section .rodata\n"
|
||||
asm += f".global {symbol}\n"
|
||||
asm += f"{symbol}:\n"
|
||||
asm += data.link(symbol)[0]
|
||||
asm += (assembly or "")
|
||||
|
||||
data = None
|
||||
assembly = asm
|
||||
|
||||
if data is None and assembly is None:
|
||||
raise FxconvError("elf() but no data and no assembly")
|
||||
|
||||
# Toolchain parameters
|
||||
|
||||
if toolchain is None:
|
||||
|
@ -1220,6 +1206,20 @@ def elf(data, output, symbol, toolchain=None, arch=None, section=None,
|
|||
raise FxconvError(f"non-trivial architecture for {toolchain} must be "+
|
||||
"specified")
|
||||
|
||||
# Unfold ObjectData into data and assembly
|
||||
if isinstance(data, ObjectData):
|
||||
asm = ".section " + section.split(",",1)[0] + "\n"
|
||||
asm += f".global {symbol}\n"
|
||||
asm += f"{symbol}:\n"
|
||||
asm += data.link(symbol)[0]
|
||||
asm += (assembly or "")
|
||||
|
||||
data = None
|
||||
assembly = asm
|
||||
|
||||
if data is None and assembly is None:
|
||||
raise FxconvError("elf() but no data and no assembly")
|
||||
|
||||
# Generate data - in <output> directly if there is no assembly
|
||||
|
||||
if data:
|
||||
|
|
Loading…
Reference in a new issue