Commit Graph

83 Commits

Author SHA1 Message Date
bbbradsmith 8b818aac67 remove trailing space on segment "bytes" warning plural 2023-03-07 18:42:20 -05:00
Bob Andrews a299ef4210
Merge pull request #1995 from bbbradsmith/overwrite_segment_fix
ld65 fix overwrite segments adding wrong padding or causing internal errors
2023-02-24 21:27:33 +01:00
bbbradsmith 5bc8ff98de error if computed memory size is negative 2023-02-19 09:01:17 -05:00
bbbradsmith 2ac055383f ld65 fix overwrite segments adding wrong padding or causing internal errors 2023-02-19 08:14:04 -05:00
laubzega dc4142e1a9 Minor formatting changes after review. 2020-05-29 10:00:33 +02:00
laubzega 083f3ae26b Fix for #928. 2020-05-29 10:00:33 +02:00
bbbradsmith e0cb33d9d4 SEGMENT start of 0 should be valid 2020-03-22 21:03:07 +01:00
Greg King 28584b31f1 Made the ld65 configure file's segment offset attribute accept zero as a value.
Expressions are allowed as values.  Therefore, zero might be set explicitly by some conditions.
2019-06-30 22:44:10 -04:00
Daniel Serpell b03ae76b54 Add support for INITAD to the Atari binary format. 2019-02-21 19:00:03 -03:00
Daniel Serpell 63d9b492b7 Only write full ATARI XEX header in the first chunk. 2019-02-03 18:09:51 -03:00
Daniel Serpell 0e947d594f Add support for Atari XEX file format to LD65 2019-02-03 18:04:46 -03:00
Greg King a6b04f6e97 Changed most "backticks" (grave accents) into apostrophes.
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
Evgeny Vrublevsky d4088f9eee Don't output a warning about alignment when section address is defined by START or OFFSET and fits required alignment requirements 2018-10-18 15:37:14 +02:00
Laubzega d293d766ef New segment type renamed to "overwrite". 2018-09-08 19:18:41 -07:00
Laubzega c7bb27bac9 Rename more stuff from "overlay" to "replace". 2018-09-06 00:18:39 -07:00
Laubzega cd9efd53fe Segment OVERLAY renamed to REPLACE. Bugfix for read-only segments. Formatting. 2018-09-04 00:34:28 -07:00
Laubzega 8b584cb89f Add segment type "overlay". 2018-08-25 10:18:23 -07:00
Greg King fac246c799 Moved a warning message, about misaligned segments, to a configuration function.
It used to be shown only if the segment was written into a binary file.  Now, it's shown for all badly-aligned segments.
2016-03-29 05:40:12 -04:00
Greg King 8e9bf4d419 Changed the way that ld65 handles bad offset/start segment attributes, and reports memory area overflows.
1. Offset/start attributes within a memory area are ignored after an overflow.
2. If a previous segment ends past an offset/start address, then that address is not used.
3. Short map files were generated for memory overflows; now, they are generated for bad offset/start addresses, too.
2015-10-22 19:24:08 -04:00
Greg King 0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt 4185caf855 Normalized code. 2014-03-04 01:11:19 +01:00
Greg King cf7f7b9ef2 Fixed ld65's precalculation of memory-area sizes.
Before this fix, BSS-type and ZP-type segments never were counted.  Now, they are counted if their memory areas are filled.  (It must be done because their places in the output file are filled.)

The fix allows us to build programs for the CBM510 and CBM610 platforms.  We won't see an "Internal error" diagnostic message about a bad file-offset.
2013-07-10 02:37:09 -04:00
Oliver Schmidt 85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
Oliver Schmidt 37c492b544 Replaced builtin linker configs with ordinary .cfg files.
The benefits are:
- Independency of ld65 build from perl
- More transparent behaviour
2013-04-09 23:09:46 +02:00
uz 77bd3169f6 Added a new attribute IMPORT to the CONDES definition of the FEATURES section.
If this attribute is defined, an import for the given symbol is added to the
module that contains the condes declaraction. Using this feature, it is
possible to force linkage of a module that contains an export for the symbol.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5900 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-11-03 21:37:19 +00:00
uz 574c8fa273 Added a "fillval" attribute to the segment definition. When given, it
overrides the value from the memory area for all space that lies within the
segment itself.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5823 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-09-09 19:00:43 +00:00
uz 43ea0e3df9 Move evaluation of the argument for .BANK into the linker. It is otherwise too
restricted, since no imported symbols may be used.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5746 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-06-30 17:18:03 +00:00
uz 1fccae4cff Finish support for .BANK.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5384 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-04 22:45:26 +00:00
uz ad88e77f43 Fixed an error in file offset calculation.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5380 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-04 21:45:11 +00:00
uz 9e68be3842 Started to add a new .BANK instruction that allows access to a memory area
attribute named "bank". Some error checks and a lot of testing is required.
Don't use for now.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5375 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-03 21:41:34 +00:00
uz a9f48e663b Symbols imported from the linker config must have the config file position
added to the symbol references, not the definitions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5367 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-02 12:39:55 +00:00
uz e935c8fead Fixed a problem: For symbols of type weak or external defined in the linker
config, a value is mandatory, but the check inside the code checked for the
TYPE attribute instead of the VALUE attribute.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5357 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-01 20:29:42 +00:00
uz 081308942c Let the linker generate a new symbol __NAME_FILEOFFS__ that contains the
offset of a memory area in the output file. Partially based on a contribution
by David M. Lloyd, david.lloyd@redhat.com.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5351 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-12-31 15:21:33 +00:00
uz 6ead4abf24 Added support for arbitrary alignments.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5341 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-12-28 16:28:19 +00:00
uz 1797235794 Read and manage additional line information for symbols.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5215 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-18 16:27:18 +00:00
uz c25694f54d Fixed another memory leak.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5106 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-02 14:49:33 +00:00
uz 733e832b5d Use LineInfo instead of raw FilePos objects. Most information in the object
files does now have lists of LineInfos attached. Compiles but UNTESTED!


git-svn-id: svn://svn.cc65.org/cc65/trunk@4921 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-01-26 19:42:17 +00:00
uz de14990fbb Define the __XX_START__ symbol for a memory area earlier, so it may be used in
the expression for the size of the same area.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4852 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-12 18:01:31 +00:00
uz 5e8252fa36 Reworked and improved the SYMBOLS section. The old syntax (using symbol =
value) is now gone, attributes are used instead. The SYMBOLS section does now
support imports, so the linker config can be used to force symbols (and
therefore module) imports. Evaluation of start address and size for memory
areas has been delayed even further, so it is now possible to use the values
from one memory area in the definition of the next one.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4851 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-12 14:17:35 +00:00
uz 7c1094c086 Keep the config file position in a FilePos structure.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4847 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-10 19:52:40 +00:00
uz 7bd19b737a One more place where OutputNameUsed must be flagged.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4844 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-09 22:07:45 +00:00
uz a2b7ef2b08 Merge CfgProcess and CfgAssignSegments because both do some sort of
postprocessing. Print a warning if %O was used in the config file and the
output file name is changed later using -o.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4842 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-09 21:01:27 +00:00
uz da792b3fd0 Separate processing the linker config file into two phases: The config file is
read when the -t or -C switch is encountered and parts of it are processed.
The remaining parts are processed when all object files and libraries have
been read. To make this work, the expression evaluation in cfgexpr has been
rewritten to generate true expression trees. This means that expressions in
the linker config may use exports from the object files. 

Separation of config file processing is the base for several enhancements, for
example forced imports by linker config.

This code needs more work and is only very, very, very roughly tested.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4840 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-08 21:52:24 +00:00
uz 34c938e7ac More collection usage. This has also removed the need for the MemListNode
structure.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4795 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-08 15:35:56 +00:00
uz fedb265a22 More collection usage.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4794 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-08 15:23:22 +00:00
uz ad140bede4 Replace more linked lists by collections.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4793 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-08 15:13:53 +00:00
uz 026724482f Use collections instead of linked lists to simplify things.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4792 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-08 15:03:58 +00:00
uz b759e753e4 Changed the type of CfgSVal to a string buffer and removed the upper limit for
the length.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4627 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-03-20 17:23:51 +00:00
cuz 9174f65e54 Make much more usage of dynamic strings (StrBufs) instead of char* and
friends. Since names and other strings are now StrBufs in many places, code
for output had to be changed.
Added support for string literals to StrBuf.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3825 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-03-31 20:54:45 +00:00
cuz b6ac59be03 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@3558 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-07-29 20:33:25 +00:00