Commit Graph

58 Commits

Author SHA1 Message Date
Shamus Hammons 8e049701be Fix for bug #191, thanks to jagmod for the report. 2022-08-16 12:30:52 -05:00
Shamus Hammons ea99cb44af Version bump for latest commits. 2022-08-15 21:32:36 -05:00
James Jones 0fd021e7f8 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.
2022-08-15 21:31:52 -05:00
James Jones 0d71dcf002 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.
2022-08-15 21:31:44 -05:00
Shamus Hammons a63bf68077 Version bump for last commit. 2022-08-15 21:28:33 -05:00
James Jones 304cdee3e0 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.
2022-08-15 21:27:58 -05:00
Shamus Hammons f63e6b2da1 Version bump for latest patches. 2022-08-15 21:24:39 -05:00
James Jones a0516e2c2a 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.
2022-08-15 21:22:44 -05:00
ggn cc23da7a6e Fix for #190, thanks to jagmod for the report 2022-08-15 21:19:32 -05:00
Shamus Hammons a839b5e1b4 Update to the name (don't ask), and copyright dates. Now at v.1.7.0. 2021-03-07 16:50:58 -06:00
Shamus Hammons 52963cddfc Added .gitignore. This should take care of bug #161. 2020-05-30 09:11:20 -05:00
Shamus Hammons 459661e27f Fix for bug #132 (warnings for non-exclusive options).
Thanks to LinkoVitch for the report; now at v1.6.4.
2020-02-28 17:57:27 -06:00
Shamus Hammons e0c5bd1817 Forgot internal documentation for last commit. :-P 2020-02-28 17:15:53 -06:00
Seb/The Removers 3901d04596 Patch to add -y option. 2020-02-28 17:13:26 -06:00
Shamus Hammons bd10a921a7 Fix to test to see if include paths actually exist.
RLN will now yell at you if you give it an include path that doesn't
exist.  Thanks to ggn for the idea!  :-)
2020-02-28 16:54:05 -06:00
Shamus Hammons fd9ba5f319 Forgot to bump the version. Now at v1.6.2. 2020-02-28 16:16:05 -06:00
Shamus Hammons d6008be63c 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.  :-/
2020-02-28 16:08:24 -06:00
Shamus Hammons 822fb0b235 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!).
2018-02-26 20:37:05 -06:00
Shamus Hammons 2b769046eb Patch to properly handle WORD sized symbol relocations by SainT.
Version now at 1.5.2.
2017-10-04 09:31:20 -05:00
Shamus Hammons 05f3a96e41 Fix for -n and -l flags. Thanks to C. Forhan for reporting. 2016-06-14 13:25:45 -05:00
Shamus Hammons 9ab479822c 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.
2015-12-07 22:24:50 -06:00
Shamus Hammons ed794c04e7 Revbump for last commit. :-P 2015-12-07 08:27:25 -06:00
Shamus Hammons cf65d78a03 Should be final fix for bug #36. :-P 2015-12-06 19:40:21 -06:00
Shamus Hammons 52b539ef19 Forgot revbump for last commit. :-P 2015-11-28 14:02:45 -06:00
Shamus Hammons e9b8d47a05 Fix for stupid bug that truncated -i symbols to 7 chars instead of 8. 2015-11-28 14:01:27 -06:00
Shamus Hammons a0c533714d Version # bump, as the last change was more than just a patch. :-) 2015-11-26 08:23:57 -06:00
Shamus Hammons ef0a4c2b77 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.
2015-11-25 22:39:34 -06:00
Shamus Hammons 5c7a0db5a2 Fix for bug #37 (Wrong values in data symbols when linking mult. files)
Thanks to SCPCD for the patch! Also, revbump to v.1.3.6.
2015-09-03 07:48:15 -05:00
Shamus Hammons 1614b4cc59 Changed wording of warning to be more clear to end user. 2015-02-03 08:37:00 -06:00
Shamus Hammons 65c5194d32 Allow linking to internal symbols _TEXT_E, _DATA_E, & _BSS_E.
Also, added -u (allow unresolved symbols) flag. Probably doesn't work as
expected; it may go away in the future.
2015-01-26 09:23:02 -06:00
Shamus Hammons 4635567e96 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.
2015-01-22 11:48:48 -06:00
Shamus Hammons 5644d37956 Fix for crash on Win32.
Need to address the underlying problem, for now this is just a quick fix.
2014-12-24 12:42:17 -06:00
Shamus Hammons 64a3b267ea Fix makefile to work with cross-compile script. 2014-12-20 16:59:12 -06:00
Shamus Hammons 3e667b86e2 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. :-)
2014-12-20 11:06:52 -06:00
Shamus Hammons 8cffb87a80 And now we have proper lazy linking of AR (*.a) archives.
The code probably needs some more cleanup, but now it's in much better
shape than it was before.
2014-12-19 10:55:40 -06:00
Shamus Hammons ccc8cc33ff More archive file hacking... 2014-12-16 08:49:23 -06:00
Shamus Hammons 20972dfe98 Next try in supporting ar (*.a) archive files. 2014-12-16 08:08:15 -06:00
Shamus Hammons 062df8602b Added preliminary ar (*.a) archive support. 2014-12-15 11:49:54 -06:00
Shamus Hammons a1f6a3912c Patch to accept gcc objects submitted by ggn. 2014-12-11 08:32:52 -06:00
Shamus Hammons 1bfcf5edc6 Added cross-compilation script 2014-05-12 09:55:37 -05:00
Shamus Hammons f60139df3c Fixed bug with absolute globals not being relocated properly. 2014-01-15 22:22:28 -06:00
Shamus Hammons a9928b064f Fixed warning that did not respect -w flag. 2014-01-14 12:06:18 -06:00
Shamus Hammons caa7d37ad5 Fixed bug with iscommon() macro. 2014-01-14 11:53:48 -06:00
Shamus Hammons 6d62efb30e Added optimization flags to makefile 2013-02-14 13:24:21 -06:00
James Hammons 741d94dd19 Clean up of path_tail() function; now uses defined path delimiter. 2011-12-29 17:13:33 +00:00
James Hammons 7a68775424 Fixed makefile to do automagic platform detection. 2011-12-29 16:51:26 +00:00
James Hammons 4d8573013a Reverted changes made to utter failure in the header. :-) 2011-12-29 16:00:52 +00:00
James Hammons 35f3e59d5c Added -w (show warnings) switch. 2011-12-29 15:36:23 +00:00
James Hammons 8cc0bb287b Missed a spurious debugging printf. :-P 2011-12-29 15:22:35 +00:00
James Hammons 7748e5d517 Moar cleanups, fixing basic types to use C99 standard types. 2011-12-29 15:18:15 +00:00