Skip to content

Commit

Permalink
extra space in functionreplacemodifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Lerner authored and Sam Lerner committed May 23, 2024
1 parent bdb378b commit 387ebe6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion ofrak_core/ofrak/core/patch_maker/modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def _make_text_segment(complex_block: ComplexBlock) -> Segment:
vm_address=complex_block.virtual_address,
offset=0,
is_entry=False,
length=complex_block.size,
length=complex_block.size + 0x100,
access_perms=MemoryPermissions.RX,
)

Expand Down
24 changes: 7 additions & 17 deletions ofrak_patch_maker/ofrak_patch_maker/toolchain/llvm_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,21 @@ def __init__(
self._assembler_flags.append(f"-mcpu={self._config.assembler_cpu}")
self._compiler_flags.extend(
[
"-c",
"-target",
"-cc1",
"-triple",
self._compiler_target, # type: ignore
"-Xclang",
"-emit-obj",
"-msoft-float",
"-mfloat-abi",
"soft",
"-Wall",
]
)
if processor.isa is InstructionSet.ARM:
# Without this option, Clang will ignore target("arm"/"thumb") attributes
self._compiler_flags.append("-marm")

if self._config.hard_float:
self._compiler_flags.append("-mno-soft-float")
else:
self._compiler_flags.append("-msoft-float")

if self._config.separate_data_sections:
self._compiler_flags.append("-fdata-sections")
if self._config.compiler_cpu:
self._logger.warning("compiler_cpu option set, but has no meaning for LLVM toolchain")
self._compiler_flags.append(f"-mcpu={self._config.compiler_cpu}")

llvm12_compiler_optimization_map = {
CompilerOptimizationLevel.NONE: "-O0",
Expand All @@ -82,10 +76,9 @@ def __init__(
self._compiler_flags.append("-finline-hint-functions")

if self._config.relocatable:
self._compiler_flags.extend(["-fno-direct-access-external-data", "-fPIE"])
self._compiler_flags.extend(["-fno-direct-access-external-data", "-pic-is-pie"])
self._linker_flags.append("--pie")
else:
self._compiler_flags.append("-fno-pic")
self._linker_flags.append("--no-pie")

if self._config.no_bss_section:
Expand All @@ -98,11 +91,8 @@ def __init__(
self._compiler_flags.extend(
[
"-fno-split-dwarf-inlining",
"-Xclang",
"-debug-info-kind=limited",
"-Xclang",
"-dwarf-version=4",
"-Xclang",
"-debugger-tuning=gdb",
]
)
Expand Down

0 comments on commit 387ebe6

Please sign in to comment.