22 July 2017, 14:17 | #1 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
gcc sas/c link problem
i try to build a binary using gcc 2.95.3 and an object file (slib4.o) made by sas/c,
the result is some errors listed: Code:
$ m68k-amigaos-g++.exe -g goo.cc -m68020 -m68881 -noixemul -ISDK/include slib4.o -o goo.p hunk_drelx not supported yet hunk_drelx not supported yet hunk_drel16 not supported yet hunk_drel16 not supported yet slib4.o: file not recognized: No error collect2: ld returned 1 exit status slib4.o: Code:
0000 00 00 03 e7 00 00 00 02 73 6c 69 62 34 2e 63 00 |........slib4.c.| 0010 00 00 03 e8 00 00 00 01 74 65 78 74 00 00 03 e9 |........text....| 0020 00 00 00 1e 48 e7 00 0a 49 f9 00 00 00 00 30 7c |....H...I.....0|| 0030 00 04 29 50 00 00 43 ec 00 00 70 25 2c 78 00 04 |..)P..C...p%,x..| 0040 4e ae fd d8 29 40 00 04 67 20 61 00 00 00 4a 80 |N...)@..g a...J.| 0050 66 08 61 00 00 00 4a 80 66 12 61 00 00 00 22 6c |f.a...J.f.a..."l| 0060 00 04 2c 78 00 04 4e ae fe 62 70 00 4c df 50 00 |..,x..N..bp.L.P.| 0070 4e 75 48 e7 00 0a 49 f9 00 00 00 00 2f 2f 00 0c |NuH...I.....//..| 0080 61 00 00 00 61 00 00 00 22 6c 00 04 2c 78 00 04 |a...a..."l..,x..| 0090 4e ae fe 62 58 4f 4c df 50 00 4e 75 00 00 03 f8 |N..bXOL.P.Nu....| 00a0 00 00 00 01 00 00 00 01 00 00 00 14 00 00 00 04 |................| 00b0 00 00 00 02 00 00 00 66 00 00 00 3c 00 00 00 22 |.......f...<..."| 00c0 00 00 00 10 00 00 00 00 00 00 03 ef 81 00 00 03 |................| 00d0 5f 4c 69 6e 6b 65 72 44 42 00 00 00 00 00 00 02 |_LinkerDB.......| 00e0 00 00 00 54 00 00 00 06 83 00 00 03 5f 5f 5f 66 |...T........___f| 00f0 70 69 6e 69 74 00 00 00 00 00 00 01 00 00 00 28 |pinit..........(| 0100 83 00 00 02 5f 53 74 61 72 74 75 70 00 00 00 01 |...._Startup....| 0110 00 00 00 30 83 00 00 03 5f 5f 5f 66 70 74 65 72 |...0....___fpter| 0120 6d 00 00 00 00 00 00 02 00 00 00 62 00 00 00 38 |m..........b...8| 0130 83 00 00 03 5f 53 68 75 74 64 6f 77 6e 00 00 00 |...._Shutdown...| 0140 00 00 00 01 00 00 00 5e 01 00 00 03 5f 5f 53 74 |.......^....__St| 0150 61 72 74 75 70 00 00 00 00 00 00 00 01 00 00 03 |artup...........| 0160 5f 5f 53 68 75 74 64 6f 77 6e 00 00 00 00 00 4e |__Shutdown.....N| 0170 00 00 00 00 00 00 03 f1 00 00 00 03 00 00 00 00 |................| 0180 4f 50 54 53 00 04 00 40 00 00 03 f2 00 00 03 e8 |OPTS...@........| 0190 00 00 00 02 5f 5f 4d 45 52 47 45 44 00 00 03 ea |....__MERGED....| 01a0 00 00 00 03 64 6f 73 2e 6c 69 62 72 61 72 79 00 |....dos.library.| 01b0 00 00 03 f2 00 00 03 e8 00 00 00 02 5f 5f 4d 45 |............__ME| 01c0 52 47 45 44 00 00 03 eb 00 00 00 02 00 00 03 ef |RGED............| 01d0 01 00 00 02 5f 53 79 73 42 61 73 65 00 00 00 00 |...._SysBase....| 01e0 01 00 00 02 5f 44 6f 73 42 61 73 65 00 00 00 04 |...._DosBase....| 01f0 00 00 00 00 00 00 03 f2 |........| while gcc6.x reports lots of deprecated stuff. --std=c++98 does not help i can build the goo.o object file without problem: Code:
$ m68k-amigaos-g++.exe -g -c goo.cc -m68020 -m68881 -noixemul -ISDK/include Code:
0000 00 02 01 07 00 00 2a 9c 00 00 01 0c 00 00 00 18 |......*.........| 0010 00 00 5c c4 00 00 00 00 00 00 07 20 00 00 00 30 |..\........ ...0| 0020 4c 57 20 49 74 65 6d 20 49 6e 66 6f 20 32 00 4c |LW Item Info 2.L| 0030 57 20 4f 62 6a 65 63 74 20 49 6e 66 6f 00 4c 57 |W Object Info.LW| 0040 20 42 6f 6e 65 20 49 6e 66 6f 00 4c 57 20 4c 69 | Bone Info.LW Li| 0050 67 68 74 20 49 6e 66 6f 20 32 00 4c 57 20 43 61 |ght Info 2.LW Ca| 0060 6d 65 72 61 20 49 6e 66 6f 00 4c 57 20 53 63 65 |mera Info.LW Sce| 0070 6e 65 20 49 6e 66 6f 20 32 00 4c 57 20 49 6d 61 |ne Info 2.LW Ima| 0080 67 65 20 4c 69 73 74 00 4c 57 20 43 6f 6d 70 6f |ge List.LW Compo| 0090 73 69 74 69 6e 67 20 49 6e 66 6f 00 47 6c 6f 62 |siting Info.Glob| 00a0 61 6c 20 52 65 6e 64 65 72 20 4d 65 6d 6f 72 79 |al Render Memory| 00b0 00 49 6e 66 6f 20 4d 65 73 73 61 67 65 73 00 46 |.Info Messages.F| 00c0 69 6c 65 20 52 65 71 75 65 73 74 00 53 79 73 74 |ile Request.Syst| 00d0 65 6d 20 49 44 00 4e 55 00 00 2f 0b 2f 0a 24 6d |em ID.NU.././.$m| .... Last edited by emufan; 22 July 2017 at 14:29. |
22 July 2017, 16:03 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
AROS 68k comes with a utility called elf2hunk that converts GCC/AROS native binaries to Amiga/Hunk binaries. There should be a similar converter in the GCC BinUtils that imports Hunk objects or linker libraries to ELF format. I think it is called Lib2A or something like that.
|
22 July 2017, 17:28 | #3 | |||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
You cannot convert this object into anything else when your compiler or linker does not support small data in the same manner. You also need a startup code which sets up A4 with the base address. The linker has to provide _LinkerDB for the base, etc.. Only solution would be to recompile slib4 with gcc, but without small data mode. Quote:
Quote:
Or try to convert the a.out object with vlink. For example (untested): Code:
vlink -bamigahunk -r -o goo_hunk.o goo.o |
|||
22 July 2017, 17:42 | #4 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
thanks for all the info.
elf2hunk/Lib2A i cannot find in my gcc 2.95.3/6.3.x builds. vlink is more promissing, but fails: Code:
$ /opt/m68k-amigaos6/bin/vlink -bamigahunk -r -o goo_hunk.o goo.o vlink V0.16 (c)1997-2017 by Frank Wille INTERNAL ERROR: aout_symbols(): Symbol ___CTOR_LIST__ in goo.o has type 22, which is currently not supported. Aborting. so there might be a m68k-amigaos-g++.exe option to write hunks instead of a.out format in the object files? |
22 July 2017, 22:23 | #5 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
That's not necessary. Type 22 means it is a "set element" symbol. From /usr/include/nlist.h:
Code:
#define N_SETT 0x16 /* text set element symbol */ Quote:
But I doubt such a feature ever existed as a cross-compiler under Linux or Windows. |
|
22 July 2017, 23:48 | #6 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
http://eab.abime.net/showthread.php?t=85474 |
|
23 July 2017, 00:32 | #7 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
i tested a copy of GG lite 1.0, building the hello.c program,
the object file only (gcc -c ...) but it was the same a.out format, which i already got with the cygwin cross compiler. I have to find another version. well, the purpose of all of this, was to create a plugin for lightwave, which was solved by alkis by fixing the source code. thanks for all help. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with SAS/C 6.55 update | TheDarkCoder | Coders. General | 36 | 11 June 2021 12:17 |
GLX-related compilation problem with FS-UAE on Gentoo / GCC 4.8 | yoshi314 | support.FS-UAE | 9 | 17 December 2013 19:49 |
(Useless benchmark) Dhrystone on Sas C/Gcc/Vbcc | alkis | Coders. System | 3 | 16 October 2013 13:03 |
Problem with the SAS/C editor | Leandro Jardim | Coders. Language | 0 | 17 August 2012 08:46 |
|
|