Skip to content

Commit

Permalink
ld_bss_is_noload (ethteck#305)
Browse files Browse the repository at this point in the history
* ld_bss_is_noload

* black
  • Loading branch information
AngheloAlf authored and Xeeynamo committed Apr 3, 2024
1 parent f978fe0 commit 828c349
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# splat Release Notes

### 0.17.4

* New yaml option: `ld_bss_is_noload`
* Allows to control if `bss` sections (and derivatived sections) will be put on a `NOLOAD` segment on the generated linker script or not.
* Applies to all `bss` (`sbss`, `common`, `scommon`, etc) sections.
* Defaults to `True`, meaning `bss` sections will be put on `NOLOAD` segments.

### 0.17.3

* Move wiki to the `docs` folder
Expand Down
9 changes: 9 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ Possible values:
Specifies the starting offset for rom address symbols in the linker script.


### ld_bss_is_noload

Allows to control if `bss` sections (and derivatived sections) will be put on a `NOLOAD` segment on the generated linker script or not.

Applies to all `bss` (`sbss`, `common`, `scommon`, etc) sections.

Defaults to `True`, meaning `bss` sections will be put on `NOLOAD` segments.


## C file options

### create_c_files
Expand Down
2 changes: 2 additions & 0 deletions segtypes/common/bss.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def get_linker_section(self) -> str:

@staticmethod
def is_noload() -> bool:
if not options.opts.ld_bss_is_noload:
return False
return True

def disassemble_data(self, rom_bytes: bytes):
Expand Down
2 changes: 1 addition & 1 deletion split.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from segtypes.segment import Segment
from util import log, options, palettes, symbols, relocs

VERSION = "0.17.3"
VERSION = "0.17.4"

parser = argparse.ArgumentParser(
description="Split a rom given a rom, a config, and output directory"
Expand Down
3 changes: 3 additions & 0 deletions util/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class SplatOpts:
segment_symbols_style: str
# Specifies the starting offset for rom address symbols in the linker script.
ld_rom_start: int
# Allows to control if `bss` sections (and derivatived sections) will be put on a `NOLOAD` segment on the generated linker script or not.
ld_bss_is_noload: bool

################################################################################
# C file options
Expand Down Expand Up @@ -413,6 +415,7 @@ def parse_endianness() -> Literal["big", "little"]:
"segment_symbols_style", str, ["splat", "makerom"], "splat"
),
ld_rom_start=p.parse_opt("ld_rom_start", int, 0),
ld_bss_is_noload=p.parse_opt("ld_bss_is_noload", bool, True),
create_c_files=p.parse_opt("create_c_files", bool, True),
auto_decompile_empty_functions=p.parse_opt(
"auto_decompile_empty_functions", bool, True
Expand Down

0 comments on commit 828c349

Please sign in to comment.