Commit Graph

53 Commits

Author SHA1 Message Date
mrdudz 7165b29809 omit an error message also when an unresolved import was added by the compiler. fixes bug #1551 2022-07-14 22:54:18 +02:00
Andrea Odetti 05f545e189 More line number related changes. 2021-05-11 17:41:59 +02:00
Andrea Odetti 93762a2117 ld65: move 2 more cases to the notation file:line. 2021-05-11 17:41:59 +02:00
Andrea Odetti feccc68c54 ld65: avoid redundant error message information. 2021-05-11 17:41:59 +02:00
Andrea Odetti bcc670ee36 Standard formatting of error messages.
https://www.gnu.org/prep/standards/html_node/Errors.html

Issue: https://github.com/cc65/cc65/issues/1494
2021-05-11 17:41:59 +02:00
bbbradsmith c9355734f5 make linker generated export warning conistent with the import warning 2019-11-18 21:50:44 +01:00
bbbradsmith 788fbcc9c8 Fix silent crash failure on warning from linker command line define import size mismatch 2019-11-18 21:50:44 +01:00
Christian Groessler 5a05acf936 ld65: implement '--allow-multiple-definition' command line parameter 2019-05-01 10:57:48 +02:00
Christian Groessler c248c14075 src/ld65/exports.c: Issue an error instead of a warning for duplicate global symbols. 2019-05-01 10:57:48 +02: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
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
Christian Groessler d72e62cae2 Extend the map file to include a table of exports sorted by value. 2014-03-20 02:01:52 +01:00
Oliver Schmidt 4185caf855 Normalized code. 2014-03-04 01:11:19 +01:00
Oliver Schmidt 85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
Greg King d57ae65aad Stopped interrupt dispatcher from being linked even when there are no interruptors.
Put ld65's CONDES import names into object module's list instead of linker's list.
2013-04-22 15:55:52 -04:00
Oliver Schmidt d38b008080 Allow for warning-free build of ld65 with MS VC on warning level 3. 2013-04-09 23:10:57 +02:00
uz 274a7210e7 Fixed several issues where an object file reference or line infos were
accessed when they in fact didn't exist, because the symbol was linker
generated (in the config or on the command line).


git-svn-id: svn://svn.cc65.org/cc65/trunk@5981 b7a2c559-68d2-44c3-8de9-860c34a00d81
2013-02-10 20:56:13 +00: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 68db31c53b Changed data type used to store line numbers from unsigned long to unsigned.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5222 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-19 10:44:45 +00:00
uz 5f0e6dd7e9 Output all positions in a file for unresolved externals.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5221 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-19 10:40:11 +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 3996725f44 Write imports out to the debug info file. Add the id of the corresponding
export.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5186 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-16 13:58:59 +00:00
uz 11be5d6261 Handle the new symbol flags correctly. Changed - among other things - the
data types of members in the management structures.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5180 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-16 11:50:27 +00:00
uz b8d43cee42 Tracked rename of hashstr -> hashfunc.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5156 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-08-12 15:36:53 +00:00
uz 795d9e1a1c Mark the symbol that is the name of a scope with the size of that scope
(previously only the scope itself had that size).
Pass the size of symbols through the object file to the linker. Bump the
object file version and adjust object file reading tools (od65, ar65) to this
change.
Read the size in the linker and output it in the debug info.
Bump the minor version number of the debug info. Read the size and allow to
access it via the API. Do better version checking for the debug info and try
to be smarter when encountering unknown keywords to improve support for newer
minor versions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5057 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-06-13 18:43:50 +00:00
uz fa1b5f5f3c Fixed a bug: Wrong variable size trucates data.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4945 b7a2c559-68d2-44c3-8de9-860c34a00d81
2011-01-28 16:03:41 +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 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 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 112ae0e3db Renamed the defines in symdefs.h to something more meaningful. They were named
EXP_xxx for historic reasons, but SYM_ does make much more sense now.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4812 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-08-17 20:47:27 +00:00
uz ee6028993e Added a new "--force-import" command line option to the linker.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4052 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-08-27 14:43:44 +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 9cd0b7705c Fixed a bug: If all output data was discarded (by using file = "" in the
linker config), CheckExports was never called, which in turn meant that
the list of all exports was never built. This caused a crash later when
the linker tried to generate a map file. The solution is to separate the
creation of the exports list and the check for unresolved imports.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3360 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-01-09 13:16:51 +00:00
cuz b58b62c77e Better error messages
git-svn-id: svn://svn.cc65.org/cc65/trunk@3025 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-12 08:51:58 +00:00
cuz 23935bd4c6 Fixed a watcom warning
git-svn-id: svn://svn.cc65.org/cc65/trunk@2823 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-22 23:13:15 +00:00
cuz 8f9a21ae3f Extend the object code format by adding a (currently empty) scope table.
Use the address size for import, export and debug symbols (object code
change).
More changes to support the --memory-model switch and address sizes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2691 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-11-28 22:12:14 +00:00
cuz 18fb938f48 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@2625 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-11-09 12:11:42 +00:00
cuz eb5637b6e4 More stringpool use / memory savings
git-svn-id: svn://svn.cc65.org/cc65/trunk@2199 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-06-05 16:50:01 +00:00
cuz edde7a3f45 Use a string pool to reduce the memory footprint
git-svn-id: svn://svn.cc65.org/cc65/trunk@2197 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-06-04 12:40:14 +00:00
cuz 76e67e2f97 Changed the object file and library format. There is now an additional
string table in the object file that (currently) holds all identifiers
from the import, export and debug info sections. The plan is to put all
strings into this table, so we have them in a central place and don't
waste memory. Apart from that, the indices are unique, so comparing strings
should be a lot easier than before (as soon as the programs take advantage
of this fact, which is currently not the case).


git-svn-id: svn://svn.cc65.org/cc65/trunk@2169 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-05-25 17:57:50 +00:00
cuz abcc981253 Move the Debug flag into a new module "debugflag" in the common directory.
Remove the const qualifier from the argument of xfree().


git-svn-id: svn://svn.cc65.org/cc65/trunk@1877 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-01-04 16:59:51 +00:00
cuz 0774fe273a Did some renaming and cleanup: Renamed EXPR_SEGMENT to EXPR_SECTION, since
this is what it really is. Added a real EXPR_SECTION which is now used in
the linker to represent the run address of a segment, provided that it is
requested to be defined. Changed some named in use of EXPR_MEMAREA. Added
handling of the new EXPR_SEGMENT to both, the binary and o65 output format.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1769 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-12-14 22:57:00 +00:00
cuz 90ca5c1af9 Added o65 symbol export capability
git-svn-id: svn://svn.cc65.org/cc65/trunk@1127 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-12-01 17:14:12 +00:00
cuz 3e887bd9dd Flag labels in the map file exports list
git-svn-id: svn://svn.cc65.org/cc65/trunk@877 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-09-08 22:09:30 +00:00
cuz 518220f9cf First finished implementation of the condes feature
git-svn-id: svn://svn.cc65.org/cc65/trunk@456 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-11-20 21:56:48 +00:00
cuz b9970cb7da Working on the condes feature
git-svn-id: svn://svn.cc65.org/cc65/trunk@451 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-11-20 15:22:57 +00:00
cuz 12996ee12b New module to handle initializers
git-svn-id: svn://svn.cc65.org/cc65/trunk@432 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-11-03 09:31:18 +00:00
cuz 18840117ec Removed underlines from structure names.
Moved the fragment type into its own module.


git-svn-id: svn://svn.cc65.org/cc65/trunk@430 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-11-02 22:11:25 +00:00
cuz 72e32b332b Working on initializers
git-svn-id: svn://svn.cc65.org/cc65/trunk@411 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-10-30 20:48:11 +00:00
cuz 097a01094e Added a method to write variable sized unsigned values. Use this method for
all sorts of things in the object files. This does not only make the object
files smaller, but does also remove several limits (strings may be longer
than 255 bytes, several counters no longer have 8 or 16 bit limits).


git-svn-id: svn://svn.cc65.org/cc65/trunk@260 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-02 13:23:06 +00:00