mirror of
https://github.com/switchbrew/switch-tools.git
synced 2025-06-21 21:42:39 +02:00
Fixed bss handling in tools.
This commit is contained in:
parent
48ef86ca71
commit
7c9b0c8f9e
@ -126,7 +126,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
// .bss is special
|
||||
if (i == 3) {
|
||||
nro_hdr.bssSize = (phdr->p_memsz + 0xFFF) & ~0xFFF;
|
||||
nro_hdr.bssSize = ((phdr->p_memsz - phdr->p_filesz) + 0xFFF) & ~0xFFF;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -127,9 +127,9 @@ int main(int argc, char* argv[]) {
|
||||
nso_hdr.Segments[i].DstOff = phdr->p_vaddr;
|
||||
nso_hdr.Segments[i].DecompSz = phdr->p_filesz;
|
||||
|
||||
// for .data segment this field contains total sz including bss
|
||||
// for .data segment this field contains bss size
|
||||
if (i == 2)
|
||||
nso_hdr.Segments[i].AlignOrTotalSz = phdr->p_memsz;
|
||||
nso_hdr.Segments[i].AlignOrTotalSz = phdr->p_memsz - phdr->p_filesz;
|
||||
else
|
||||
nso_hdr.Segments[i].AlignOrTotalSz = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user