Commit graph

33 commits

Author SHA1 Message Date
carl c5f5bace63 Add additional defines for compilation. 2019-03-24 17:08:45 +08:00
George Koehler 4fdfa3177e Fix em_led -u name when memory allocator moves ALLOMODL.
Option -u was passing an offset from modulptr(0) in ALLOMODL to the
string in argv.  If entername() would move ALLOMODL to make room in
ALLOGCHR, then the offset would become invalid, so the string would
get lost.  This fix copies the string into ALLOMODL.

This was often not a problem because the initial size of ALLOGCHR in
mach.h is probably large enough for -u.  This became a problem when I
caused the initial allocations to fail, and then only because the B
runtime uses -u.
2018-11-14 12:35:38 -05:00
George Koehler f09f14cd4d Switch from long to size_t when allocating memory.
Also move the declarations of `incore` and `core_alloc` to "memory.h".
Also correct SYMDEBUG to SYMDBUG.  (I don't know if SYMDBUG works
because our build system never defines it.)

ind_t becomes an alias of size_t.  ind_t becomes unsigned, so I edit
some code that was using negative ind_t.  Some casts disappear, like
(long)sizeof(...) because the size is already a size_t.  There are
changes to overflow checks.  Callers with a size too big for size_t
must check it before calling the memory allocator.  An overflow check
of BASE + incr in memory.c sbreak() now happens on all platforms, not
only when a pointer is smaller than a long.

My build shows no changes in share/ack/examples (except hilo_bas.*
changing with every build).
2018-11-14 12:33:25 -05:00
David Given 5264db860d Values are more useful shown in hex. 2018-09-11 23:17:09 +02:00
David Given 4cb4bdc85f There are two places where names are added to the global symbol table; one via
the -U command line option, and one via file scanning. Turns out only the
second would increment the number of global names, so adding names with -U
would cause names found via scanning to fall off the end of the list! This
wouldn't cause linker errors because fixups don't use the list, but would cause
the generated symbol table in the output to be incorrect.
2018-03-11 12:37:23 +01:00
David Given fd10cf7ac2 Merge from trunk. 2017-08-06 10:42:16 +02:00
David Given d5a83fd73e Clean up the led includes. 2017-01-18 19:55:56 +01:00
David Given 52f82a76b6 Don't crash when using the -u option to enter undefined symbols. 2016-12-28 23:49:55 +00:00
George Koehler ecdfb61c9d Merge branch 'default' into kernigh-osx
This brings in David Given's PowerPC changes, including the addition
of the modern code generator (mcg) for PowerPC.

Resolve minor conflicts in top build.lua and util/led/main.c
2016-11-28 16:20:56 -05:00
David Given 3e69d1185a Fix a whole lot more stray prototypes. 2016-11-24 21:47:40 +01:00
George Koehler 88c2ea63aa Use uint32_t in util/led/main.c
This uses uint32_t for the base, file offset, and alignment of each
section, to be consistent with the usage of uint32_t in h/out.h

Also declare setbit() as static.
2016-11-20 11:38:16 -05:00
David Given fd91851005 Add enough return types to the K&R C that the ACK builds (on Linux) using clang
now.
2016-11-10 22:04:18 +01:00
dtrg 014be56fb0 Replaced calls to the custom strindex() and strrindex() functions with the
exactly equivalent and standard strchr() and strrchr() functions instead.
2006-07-23 20:01:02 +00:00
ceriel 56033dc0c1 Added -n flag 1996-11-21 10:14:26 +00:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel df1ed9426d Do not use '#endif/#else xxx'; it is not allowed for ANSI C 1991-12-17 15:28:58 +00:00
ceriel 1168708cd0 Added support for S_CRS 1990-07-30 11:56:28 +00:00
ceriel f2b4713c24 cast ptrdiff_t to int for ANSI 1990-04-25 14:23:05 +00:00
ceriel 0b95807664 Added verbose option 1990-03-15 10:44:14 +00:00
ceriel c1ffb28416 improved the c-flag, and corrected a bug in the produced relocation info 1987-08-26 13:22:44 +00:00
ceriel d747651237 improved -c option 1987-08-19 14:10:39 +00:00
ceriel 123bcfc5e2 fix + some more statistics 1987-08-11 15:31:09 +00:00
ceriel 0300bbf5cb adapted sizes somewhat, made facility to print memory statistics 1987-08-11 14:42:15 +00:00
ceriel 45264c9c25 align sizes 1987-08-06 18:40:02 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
ceriel 8fbd81a884 A wrong flag is no longer fatal 1987-03-05 14:57:15 +00:00
ceriel 0905b2ba25 forgot a continue. 1987-02-12 13:54:37 +00:00
ceriel 10f6d88ba1 *** empty log message *** 1987-02-05 14:11:46 +00:00
ceriel baf5b74da2 A new version, that no longer tries to move all null parts to the end
of a segment. It also uses the "object" library to read and write ACK-
object files and libraries.
1986-10-20 10:17:57 +00:00
em f3e2248cc4 fixed bug in number() -- hex letters mistreated 1986-02-03 14:30:19 +00:00
keie 44ccf469d9 Changed to get led working under amoeba.
Author: K.S. Mullender.
1985-06-10 10:48:49 +00:00
keie b391be598b Now using arch.h, out.h and ranlib.h from ../../h 1985-04-18 15:21:16 +00:00
duk 55017702e2 Header and section table now allocated statically. 1985-01-10 13:22:04 +00:00