02 September 2015, 16:48 | #1 |
Posts: n/a
|
Amiga Hunk HUNK_RELOC32
Hi folks,
The relocation hunk has a number of the number of relocations. The problem is each relocation has just 1 long word. I figure that there would be 2. Let's take this line of assembly: 280: JSR 0x600 (where 0x600 is, in the executable: 0x0... 0x600 is after relocation has been parsed) 1 would specify the offset to the long that needs changing (282, after JSR opcode) and another one to indicate where the long points to (0x600). So why is there only one 32-bit long? What am I missing? Jeremy. Last edited by jeremysmith; 02 September 2015 at 17:00. Reason: Changes |
02 September 2015, 19:41 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
http://eab.abime.net/showthread.php?t=78811 should answer it (and more).
|
02 September 2015, 19:46 | #3 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Each list of relocations is preceeded by what section (what hunk in your file) it is pointing into, and after having allocated all sections, you only need to add the address of the referenced section to the relocation entry, and the relocation is complete.
|
02 September 2015, 20:52 | #4 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
1) the longword data at the relocated offset (in the code) 2) the longword of the hunk base in memory (not known until the hunk memory is allocated by the scatter loader) |
|
03 September 2015, 03:05 | #5 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
I tried to make my wiki page as detailed as possible. There's Python "pseudo-code" taken from my disassembler.
|
03 September 2015, 18:57 | #6 |
Posts: n/a
|
Thanks copse. Actually, I wanted to know about the relocations as I'm writing a 68000 disassembler.
Now that I see you have written one, I can use that, so I don't have to worry about fixing mine! I've got peasauce working now in Python. Also thanks to everyone else for their help! Cheers! Last edited by jeremysmith; 03 September 2015 at 19:22. |
26 February 2016, 13:50 | #7 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,994
|
Try to make it PC-relative as much as possible is my advice:
JSR Label(pc) instead of JSR Label |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Resourcer supporting OVERLAY hunk???? | CFou! | Coders. General | 1 | 06 March 2017 23:06 |
Amiga Hunk Loadfile Format: HUNK_RELOC32 | kiasanth | Coders. System | 3 | 25 June 2015 11:58 |
Input: Bad loadfile hunk | Turran | project.ClassicWB | 0 | 23 November 2013 11:33 |
Bad LoadFile Hunk | amiga | support.Apps | 4 | 26 June 2008 02:31 |
Problem with bad hunk files on WHDload | Peanutuk | support.Apps | 12 | 01 August 2004 18:06 |
|
|