Skip to content

Commit

Permalink
Fixed bss not getting created
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Apr 25, 2019
1 parent f996e8f commit 293c21c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/adubbz/switchloader/common/NXProgramBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ protected void load(TaskMonitor monitor)
this.setupRelocations();
this.createGlobalOffsetTable();
this.memBlockHelper.finalizeSections();
this.setupImports(monitor);
this.performRelocations();

// Create BSS
this.mbu.createUninitializedBlock(false, ".bss", aSpace.getAddress(this.nxo.getBaseAddress() + adapter.getMOD0().getBssStartOffset()), adapter.getMOD0().getBssSize(), "", null, true, true, false);
// Create BSS. This needs to be done before the EXTERNAL block is created in setupImports
Address bssStartAddr = aSpace.getAddress(this.nxo.getBaseAddress() + adapter.getMOD0().getBssStartOffset());
Msg.info(this, String.format("Created bss from 0x%X to 0x%X", bssStartAddr.getOffset(), bssStartAddr.getOffset() + adapter.getMOD0().getBssSize()));
this.mbu.createUninitializedBlock(false, ".bss", bssStartAddr, adapter.getMOD0().getBssSize(), "", null, true, true, false);

this.setupImports(monitor);
this.performRelocations();
this.markupIpc(monitor);

// Set all data in the GOT to the pointer data type
Expand Down

0 comments on commit 293c21c

Please # to comment.