James Jones [Wed, 13 Jul 2022 22:22:46 +0000 (15:22 -0700)]
Enable debug symbol propagation
The existing code was sufficient to pass through
and relocate most debug symbols as necessary. It
was just disabled for some reason. The only bugs
were in the handling of non-text line numbers,
which aren't ever used as far as I can tell, and
include files, which should be relocated like
line numbers to match ALN's behavior.
James Jones [Tue, 26 Jul 2022 10:36:50 +0000 (03:36 -0700)]
Convert output symbol table back to a table
It looks like at some point the output symbol
was converted from an actual table of SYMREC
structs to an in-memory copy of a COFF/a.out
symbol table. This entailed relying on the
assumption that all symbols had an entry in the
string table when using OSTLookup()'s return
value as anything other than a boolean value,
as is done in the relocation procesing logic.
In preparation for adding support for debug
symbols, which often have no string table entry,
revert to using an intermediate output symbol
table representation and serializing it one symbol
at a time when writing the output file. This
simplifies various code paths, but potentially
slows down writing COFF symbol tables to disk.
Fortunately, this table is not written with
default options, and is rather small unless
using debug symbols, so this shouldn't
significantly affect the runtime of most
existing use cases.
James Jones [Sat, 18 Apr 2020 09:45:06 +0000 (02:45 -0700)]
Add Alcyon C object file support
Support ingesting the DRI Alcyon C object file
format in addition to a.out object files. The load
file routine simply translates the Alcyon object
file into an a.out file before passing it on to
the existing processing workflow.
The motivation here was to enable linking of the
binary-only cinepak decompression GPU routines
provided in the developer files. ALN can handle
these files just fine, and now RLN can too.
However, that is a very simple object files To
fully exercise the relocation table translation
code, contrived assembly files with all types of
relocations were assembled as Alcyon C object
files using MADMAC and BSD/a.out object files
using RMAC (Note RMAC had to be used to generate
the a.out files because MADMAC generates invalid
a.out relocations for certain relocation types
that it handles fine in Alcyon format), and then
both object files were linked as COFF executables
using RLN. The resulting COFF files were verified
to be identical.
James Jones [Sun, 17 Apr 2022 04:11:21 +0000 (21:11 -0700)]
Handle absolute BSS segment location of 'xt'
When linking an absolute executable, the data
segment and BSS segment can be assigned an
absolute address, or the special value 'x' to
indicate they are contiguous with the prior
segment (text for data, data for BSS). However,
RLN (like MAC) also accepts an optional segment
specifier after the special value 'x' that allows
explicitly specifying which segment the current
one is contiguous with. For data, the only valid
value is 'xt', meaning contiguous with text.
However, when the data segment is specified to
be at an explicit address rather than contiguous
with the text segment, it is valid to specify that
the BSS segment is contiguous with data ('xd') or
with text ('xt'). RLN was accepting these
additional 't' and 'd' values, but ignoring them.
This change causes RLN to correctly place the BSS
segment after the text segment when its location
is specified as 'xt' as long as the data segment
isn't also contiguous with the text segment.
Shamus Hammons [Fri, 28 Feb 2020 22:08:24 +0000 (16:08 -0600)]
Fix for bug #151 (missing LFNs for BSD style archives).
Yes boys and girls, while we checked for and read the long filename
record for *both* GNU and BSD style archives, we only checked the for
the GNU case because we thought the GNU and BSD identifiers were the
same. :-/
Shamus Hammons [Tue, 27 Feb 2018 02:37:05 +0000 (20:37 -0600)]
Added fixups for OP data addresses.
This is the counterpart to the RMAC Object Processor assembler. In order
for it to be useful, we need to be able to address things in the OP
sections that refer to 68xxx TEXT and DATA sections--so now that's
possible with a little tweak to the section relocator. Now at version
1.6.1 (we forgot to commit 1.6.0, sorry!).
Shamus Hammons [Tue, 8 Dec 2015 04:24:50 +0000 (22:24 -0600)]
Major cleanup of codebase (removal of unnecessary cruft).
Any time you can throw away code is a good time; we've had a very good
time lately. :-) Mainly removed redundant structures that were bolted on
to the codebase, most likely by persons who didn't have the slightest
clue how the thing worked. That's gone now, and hopefully from here on
out, things will start to get *much* cleaner.
Shamus Hammons [Thu, 26 Nov 2015 04:39:34 +0000 (22:39 -0600)]
Possible fix for bug #36.
Also, fixed a lot of misconceptions vis-a-vis the common symbol vs. the
external, and symbol table type definitions. There's still a ways to
go, but now we're on the right track.
Shamus Hammons [Thu, 22 Jan 2015 17:48:48 +0000 (11:48 -0600)]
Fix for bug that scribbled randomly on symbols.
Whenever there was a symbol collision, the DealWithSymbol() function
would, under the right circumstances, write $0800 into a symbol for no
good reason. This has been fixed. Also fixed the realloc() nonsense
that was written incorrectly as well.
Shamus Hammons [Sat, 20 Dec 2014 17:06:52 +0000 (11:06 -0600)]
This Time For Sure :-P
The data structures in RLN are pretty piss poor in places, and likely
that way because of whoever had this code before just bodged in a bunch
of code to make it work they way they wanted it to. Trying to reverse
course on that score. :-)
Fixed the broken linking action for symbols who shared the same 8 initial characters in their names. Culprit was symcmp (wacky define in rln.h) which was just WRONG. Removed the define, and replaced with good ole strcmp in lookup().
SCPCD [Tue, 27 Dec 2011 14:39:05 +0000 (14:39 +0000)]
In "doobject" :
- strcpy(obj_fname[obj_index], fname);
+ strcpy(obj_fname[obj_index], path_tail(fname)); // SCPCD : get the name of the file instead of all pathname