Skip to content

Commit

Permalink
the section contains more than just .text contents, rename it to avoi…
Browse files Browse the repository at this point in the history
…d confusion
  • Loading branch information
DennyDai committed Apr 24, 2024
1 parent 4658a03 commit d929b70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/patcherex2/components/compilers/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def compile(
f"{name} = {hex(addr)};" for name, addr in _symbols.items()
)

linker_script = f"SECTIONS {{ .text : SUBALIGN(0) {{ . = {hex(base)}; *(.text) {linker_script_rodata_sections} {linker_script_symbols} }} }}"
linker_script = f"SECTIONS {{ .patcherex2 : SUBALIGN(0) {{ . = {hex(base)}; *(.text) {linker_script_rodata_sections} {linker_script_symbols} }} }}"
with open(os.path.join(td, "linker.ld"), "w") as f:
f.write(linker_script)

Expand All @@ -96,7 +96,7 @@ def compile(
)

text_section = next(
(s for s in ld.main_object.sections if s.name == ".text"), None
(s for s in ld.main_object.sections if s.name == ".patcherex2"), None
)
compiled_start = ld.all_objects[0].entry + base

Expand Down

0 comments on commit d929b70

Please sign in to comment.