forked from redballoonsecurity/ofrak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add x86 32-bit GNU toolchain (redballoonsecurity#405)
* Add GNU 32 bit toolchain * Update CHANGELOG * Add test for x86-gnu-32-toolchain * Fix import error * Add toolchain to toolchain.conf * Fix toolchain name * Remove build of binutils form scratch from ofrak_patch_maker Dockerstub step * Add CHANGELOG updates --------- Co-authored-by: Wyatt <[email protected]>
- Loading branch information
Showing
6 changed files
with
64 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from ofrak_patch_maker.toolchain.gnu_x64 import GNU_X86_64_LINUX_EABI_10_3_0_Toolchain | ||
from ofrak_type import ArchInfo | ||
|
||
|
||
class GNU_X86_32_LINUX_EABI_10_3_0_Toolchain(GNU_X86_64_LINUX_EABI_10_3_0_Toolchain): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
||
self._compiler_flags.append("-m32") | ||
self._assembler_flags.append("--32") | ||
self._linker_flags.extend(["-m", "elf_i386"]) | ||
|
||
@property | ||
def name(self) -> str: | ||
return "GNU_X86_32_LINUX_EABI_10_3_0" | ||
|
||
@property | ||
def segment_alignment(self) -> int: | ||
return 4 | ||
|
||
def _get_assembler_target(self, processor: ArchInfo): | ||
if self._config.assembler_target: | ||
return self._config.assembler_target | ||
return "generic32" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters