SDK 2.0 b2 - PDC produces pdx with broken binary

@dave
Finally! :astonished: Seems to I've fixed it!

Attached elf linked with attached modified linker-script where I added just one PH.
So actual PDC (2.4.2) can deal with it. And it works!

I'm not sure that link-map is optimal.

  1. I don't know where to put relocation table, so I've commented RELOC_TABLE_START and tell linker "just put it somewhere after". That's not good.
    Well, ideally I need to defy RELOC_TABLE_START or replace it with a real fixed address.
    Currently (without it) reloc-table placed randomelly after everything including BSS, and also there will bunch of zeros in the binary :man_facepalming:t2:.

  2. Also BSS I would place after everything of course, and address set it to overwrite the relocation area after they are worked out.

All of it depends on what loader expecting and how it works of course. So Dave, I ask your recomendations. Please.

solution.zip (6.0 KB)

And anyway I’m sure that this my “merge all PH in one” is terrible solution. So could be better in some far future to have “full” support of multi-sectional multi-segmental elf in PDC and loader.

1 Like