MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / loadelf

Function loadelf

src/debugmem.cpp:2462–2479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2460}
2461
2462static int loadelf(uae_u8 *file, int filelen, uae_u8 **outp, int outsize, struct sheader *sh)
2463{
2464 int size = sh->size;
2465 int asize = (size + ELF_ALIGN_MASK) & ~ELF_ALIGN_MASK;
2466 uae_u8 *out = *outp;
2467 if (outsize >= 0) {
2468 if (!out)
2469 out = xcalloc(uae_u8, outsize + asize);
2470 else
2471 out = xrealloc(uae_u8, out, outsize + asize);
2472 } else {
2473 outsize = 0;
2474 }
2475 memcpy(out + outsize, file + sh->offset, size);
2476 outsize += size;
2477 *outp = out;
2478 return outsize;
2479}
2480
2481struct loadelfsection
2482{

Callers 1

loadelffileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected