home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMIGA PD 1
/
AMIGA-PD-1.iso
/
Programme_zum_Heft
/
Programmieren
/
Workshops
/
GNU-C
/
SOBJA.LHA
/
sobja.doc
< prev
Wrap
Text File
|
1992-02-27
|
5KB
|
119 lines
------------- SObjA.doc for version 1.01 -------------
NAME
SObjA - Convert object files from Sun to Amiga format.
SYNOPSIS
SObjA [Options] Input-Filename [Output-Filename]
SObjA -m [Options] [Output-Filename]
MakeBSS Input-Filename Output-Filename
Options:
-C[Filename] Omits the 'common' information from the output file
and creates a temporary file to be read when the
'-m' option is used. The default name is
'sobja-common'. This option has a different
meaning when '-m' is used.
-c[Filename] As above but appends to the temporary file. This
option has a different meaning when '-m' is used.
-b Replaces the 'common' information in the output file
with a BSS hunk. Useful for converting a program
that is in a single object file or where none
of object files in a program define the same
global variable.
-s Include symbol information in the output file.
-m Make a file containing a BSS hunk from the temporary
file generated by SObjA with the '-c' and '-C'
options. The input filename is 'sobja-common' by
default, or it can be set using '-c' or '-C'
followed by the filename. The output filename is
given by itself on the command line or
'bss.o-amiga' by default.
-v Turns on some debugging code.
DESCRIPTION
SObjA is a utility for converting object files generated by GCC
(The GNU C Compiler) on a Sun-2 or Sun-3 to Amiga's object file
format as input to The Software Distillery's Blink. When converting
files it requires an input filename. If the output filename is
omited, it will be the same as the input's with a '-amiga' appended
to it.
BLink does not support common blocks. This support is needed for
GCC to compile programs that define any global variable in more than
one file. This is common in programs written for UN*X. SObjA has a
solution. It isn't very pretty but it works. SObjA can accumulate
common block information in a file called 'sobja-common' by default.
Once all the files in a program have been converted, it can read this
file and generate a file with a BSS hunk with definitions for the
common block references. This file can then be linked with the other
output files using Blink to generate an executable program.
Another option allows SObjA to convert a file and output a BSS
hunk for the common block references as part of the output file. This
option will probably work with programs written for other Amiga C
compilers.
The default case is for SObjA to output common block references
as specified in _The AmigaDOS Manual - 2nd Edition_. At this time I
don't know of any freely redistributable linkers for the Amiga that
support this. (BONUS: Write a good free Amiga linker.)
Note that each option must be preceded by a dash, the order of
the options and other arguments doesn't matter, and options that take
an argument should not have a space before the argument. If it
doesn't like the command line, it will give you a 'usage' message.
If this program is renamed to MakeBSS it acts differently. It
does the same thing as the '-m' option except that the input and
output filename are the only thing allowed on the command line.
EXAMPLE
You have three Sun format object files: main.c, brain.c, drain.c
SObjA -s -C main.c ; Notice the case of -C
SObjA -s -c brain.c
SObjA -s -c drain.c
SObjA -m ; Make bss.o-amiga
BLink main.o-amiga brain.o-amiga drain.o-amiga bss.o-amiga TO barf
Assuming you don't need a startup library or scanned libraries,
this will produce an executible with symbol information. The files
'sobja-common' and 'bss.o-amiga' will be in the current directory.
BUGS
Lots of them I'm sure.
GRAFFITI
"All the pumping's nearly over for my sweet heart,
This is the one for me,
Time to meet the chef,
O boy! running man is out of death.
Feel cold and old, it's getting hard to catch my breath.
's back to ash, now you've had your flash boy
The rocks, in time, compress
your blood to oil,
your flesh to coal,
enrich the soil,
not everybody's goal."
- "Anyway", Genesis - _The Lamb Lies Down on Broadway_.