So I made fixes for objconv - currently it compiles my llvm test hello world application (well actually it converts).
It works like this - you compile with whatever llvm compiler you have (I have my own but it'll probably work with clang too) to ppc32 elf.
Then you use this application to convert from elf to ppc32 (the object file).
./objconv -fmacho -nu ./test.c_1.o ./test.c_1_macho.o
Then use gcc to link, unfortunately this is what I'm currently struggling at:
gcc ./test.c_1_macho.o
Undefined symbols:
"printf", referenced from:
_actualfun in test.c_1_macho.o
_test in test.c_1_macho.o
_notajokenow in test.c_1_macho.o
_condtest in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
After fixing relocations handling for relocations used in this obj file (it's from my test application for my compiler).
(Initially it wasn't complaining about `printf` at all since it wasn't even adding it to the relocations and the app was just crashing)
Here I have uploaded the src folder with ppc32 binary, the source and my example objs.
Cheers.
EDIT: If anyone is interested actually the relocations here were not working. I managed to get the branch 24bit ones but not yet the 16 half lo/ha.
It works like this - you compile with whatever llvm compiler you have (I have my own but it'll probably work with clang too) to ppc32 elf.
Then you use this application to convert from elf to ppc32 (the object file).
./objconv -fmacho -nu ./test.c_1.o ./test.c_1_macho.o
Then use gcc to link, unfortunately this is what I'm currently struggling at:
gcc ./test.c_1_macho.o
Undefined symbols:
"printf", referenced from:
_actualfun in test.c_1_macho.o
_test in test.c_1_macho.o
_notajokenow in test.c_1_macho.o
_condtest in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
_main in test.c_1_macho.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
After fixing relocations handling for relocations used in this obj file (it's from my test application for my compiler).
(Initially it wasn't complaining about `printf` at all since it wasn't even adding it to the relocations and the app was just crashing)
Here I have uploaded the src folder with ppc32 binary, the source and my example objs.
Cheers.
EDIT: If anyone is interested actually the relocations here were not working. I managed to get the branch 24bit ones but not yet the 16 half lo/ha.
Attachments
Last edited: