Skip to content

gnu_m68k.py

ofrak_patch_maker.toolchain.gnu_m68k

GNU_M68K_LINUX_10_Toolchain (GNU_10_Toolchain)

name: str property readonly

Returns:

Type Description
str

name property that matches the value used in toolchain.conf to access paths

segment_alignment: int property readonly

For example, x86 returns 16. This will most often be used when programmatically allocating memory for code/data.

Returns:

Type Description
int

required alignment factor for the toolchain/ISA

_get_assembler_target(self, processor) private

Red Balloon Security strongly recommends all users provide their specific hardware target for best results.

Parameters:

Name Type Description Default
processor ArchInfo required

Returns:

Type Description

a default assembler target for the provided processor unless one is provided in self._config.

Exceptions:

Type Description
PatchMakerException

if no target provided and program attributes do not correspond to a default value.

Source code in ofrak_patch_maker/toolchain/gnu_m68k.py
def _get_assembler_target(self, processor: ArchInfo):
    if processor.isa is not InstructionSet.M68K:
        raise ValueError(
            f"The GNU M68K toolchain does not support ISAs which are not M68K; "
            f"given ISA {processor.isa.name}"
        )
    if self._config.assembler_target:
        return self._config.assembler_target
    arch = processor.isa.value
    if processor.sub_isa is not None:
        arch = processor.sub_isa.value
    return arch