English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 22 April 2019, 17:17   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,091
How to convert Amiga hunk executables to ELF? vlink bugs out

I posted this in the Ghidra thread but hopefully someone who knows the answer will actually read it now.

How can I convert Amiga hunk executables to ELF? I tried using the latest vlink release binary (vlink_AmigaM68k.lha) and it gave an internal error when I tried to convert C:List. That executable just contains a single code hunk, nothing fancy.
Code:
> vlink -b elf32m68k List
Warning 12: "List" is already an executable file.

INTERNAL ERROR: elf32_makeshdrs(): PHDR " dummy" offs 84 != 52
.
Aborting.
Are there any other programs which can convert executables from hunk to ELF?
mark_k is offline  
Old 22 April 2019, 17:20   #2
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Ft. Collins, CO USA
Age: 44
Posts: 1,263
Send a message via Yahoo to Samurai_Crow
AROS can run HUNK files so I can't think of any other reason you would need to convert it.
Samurai_Crow is offline  
Old 23 April 2019, 14:09   #3
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 6
Apparently you can load HUNK files into Ghidra with this plugin:
https://github.com/lab313ru/ghidra_amiga_ldr
Bartman is offline  
Old 23 April 2019, 18:20   #4
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,091
Thanks for that! And thanks to lab313ru for developing it. I'll take a look.
mark_k is offline  
Old 23 April 2019, 20:13   #5
nogginthenog
Amigan

 
Join Date: Feb 2012
Location: London
Posts: 792
Keep us informed please, this looks interesting!
nogginthenog is offline  
Old 04 May 2019, 13:39   #6
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,402
Quote:
Originally Posted by mark_k View Post
How can I convert Amiga hunk executables to ELF?
Not easily. Hunk-format executables are relocatable while the segments of an ELF executable are usually loaded to fixed absolute addresses.


Quote:
Code:
INTERNAL ERROR: elf32_makeshdrs(): PHDR " dummy" offs 84 != 52
The error message is admittedly stupid, but the problem here is that vlink has no default linker scripts for ELF, so you can only generate ELF executables when you provide a linker script with it (-T option). It defines which sections are loaded into which program segments or memory regions.
phx is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing hunk merger with vlink Hedeon Coders. C/C++ 2 24 August 2018 14:40
ELF Vs Hunk bloodline Coders. System 11 23 March 2017 16:32
Amiga Hunk HUNK_RELOC32 jeremysmith Coders. System 6 26 February 2016 13:50
Amiga Hunk Loadfile Format: HUNK_RELOC32 kiasanth Coders. System 3 25 June 2015 11:58
Elf - Ocean's Elf - could do with an update. MethodGit project.WHDLoad 9 28 August 2013 18:50

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:53.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06346 seconds with 15 queries