branch merge
This commit is contained in:
commit
db5843d904
@ -386,8 +386,8 @@ int ElfLinker::addLoader(const char *sname)
|
||||
}
|
||||
memcpy(output + outputlen, section->input, section->size);
|
||||
section->output = output + outputlen;
|
||||
//printf("section added: 0x%04x %3d %s\n", outputlen, section->size, section->name);
|
||||
outputlen += section->size;
|
||||
//printf("section added: %s\n", sect);
|
||||
|
||||
if (head)
|
||||
{
|
||||
|
||||
@ -209,6 +209,8 @@ void MemBuffer::alloc(unsigned size)
|
||||
}
|
||||
else
|
||||
b = p ;
|
||||
|
||||
//fill(0, b_size, (rand() & 0xff) | 1); // debug
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -345,7 +345,9 @@ void PackPs1::buildLoader(const Filter *)
|
||||
initLoader(nrv_loader, sizeof(nrv_loader));
|
||||
|
||||
pad_code = ALIGN_GAP((ph.c_len + (isCon ? sz_lcpr : 0)), 4);
|
||||
linker->addSection("pad.code", &pad_code, pad_code, 0);
|
||||
assert(pad_code < 4);
|
||||
static const unsigned char pad_buffer[4] = { 0, 0, 0, 0 };
|
||||
linker->addSection("pad.code", pad_buffer, pad_code, 0);
|
||||
|
||||
if (isCon)
|
||||
{
|
||||
@ -533,8 +535,6 @@ void PackPs1::pack(OutputFile *fo)
|
||||
oh.bs_ptr = oh.bs_len = 0;
|
||||
|
||||
const int lsize = getLoaderSize();
|
||||
MemBuffer loader(lsize);
|
||||
memcpy(loader, getLoader(), lsize);
|
||||
|
||||
unsigned filelen = ALIGN_UP(ih.tx_len, 4);
|
||||
|
||||
@ -614,6 +614,9 @@ void PackPs1::pack(OutputFile *fo)
|
||||
}
|
||||
|
||||
linker->relocate();
|
||||
//linker->dumpSymbols();
|
||||
MemBuffer loader(lsize);
|
||||
assert(lsize == getLoaderSize());
|
||||
memcpy(loader, getLoader(), lsize);
|
||||
patchPackHeader(loader, lsize);
|
||||
|
||||
|
||||
@ -450,7 +450,9 @@ void PackWcle::encodeImage(const Filter *ft)
|
||||
buildLoader(ft);
|
||||
|
||||
ibuf.dealloc();
|
||||
soimage = (ph.c_len + 3) &~ 3;
|
||||
soimage = ph.c_len;
|
||||
while (soimage & 3)
|
||||
oimage[RESERVED + soimage++] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user