Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

static int kldrModMachORelocateBits ( PKLDRMOD  pMod,
void *  pvBits,
KLDRADDR  NewBaseAddress,
KLDRADDR  OldBaseAddress,
void *  pvUser 
) [static]

Relocates the module bits previously obtained by kLdrModGetBits().

0 on succes, non-zero OS or kLdr status code on failure.
pMod The module.
pvBits Where to put the bits.
NewBaseAddress The new base address.
OldBaseAddress The old base address (i.e. the one specified to kLdrModGetBits() or as NewBaseAddressto the previous kLdrModRelocateBits() call).
pfnGetImport The callback ufor resolving external (imported) symbols.
pvUser The callback user argument.

Definition at line 2347 of file kLdrModMachO.c.

References mach_header_64::filetype, KLDRMODMACHO::Hdr, KLDR_ERR_TODO, kldrModMachOObjDoFixups(), kldrModMachOObjDoImports(), MH_OBJECT, and KLDRMOD::pvData.

Referenced by kldrModMachOFixupMapping(), and kldrModMachOGetBits().

    int rc;

     * Call workers to do the jobs.
    if (pModMachO->Hdr.filetype == MH_OBJECT)
        rc = kldrModMachOObjDoImports(pModMachO, pfnGetImport, pvUser);
        if (!rc)
            rc = kldrModMachOObjDoFixups(pModMachO, pvBits, NewBaseAddress);

        rc = KLDR_ERR_TODO;
        rc = kldrModMachODoFixups(pModMachO, pvBits, NewBaseAddress, OldBaseAddress, pfnGetImport, pvUser);
        if (!rc)
            rc = kldrModMachODoImports(pModMachO, pvBits, pfnGetImport, pvUser);

    return rc;

Generated by  Doxygen 1.6.0   Back to index