mirror of
https://github.com/switchbrew/switch-tools.git
synced 2025-08-07 01:09:22 +02:00
Fixed nro bss handling where bss was 1 page too large.
This commit is contained in:
parent
93f5cb18a2
commit
ffe4cfd5e2
@ -131,6 +131,7 @@ int main(int argc, char* argv[]) {
|
||||
Elf64_Phdr* phdrs = (Elf64_Phdr*) &elf[hdr->e_phoff];
|
||||
size_t i, j = 0;
|
||||
size_t file_off = 0;
|
||||
size_t tmpsize;
|
||||
|
||||
uint8_t* buf[3];
|
||||
|
||||
@ -152,7 +153,11 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
// .bss is special
|
||||
if (i == 3) {
|
||||
nro_hdr.bssSize = ((phdr->p_memsz - phdr->p_filesz) + 0xFFF) & ~0xFFF;
|
||||
tmpsize = (phdr->p_filesz + 0xFFF) & ~0xFFF;
|
||||
if ( phdr->p_memsz > tmpsize)
|
||||
nro_hdr.bssSize = ((phdr->p_memsz - tmpsize) + 0xFFF) & ~0xFFF;
|
||||
else
|
||||
nro_hdr.bssSize = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user