*** empty log message ***
This commit is contained in:
600
util/led/READ_ME
Normal file
600
util/led/READ_ME
Normal file
@@ -0,0 +1,600 @@
|
||||
You may want to change mach.c in this directory.
|
||||
|
||||
Archives MUST have a table of contents. Arch in subdirectory arch
|
||||
automatically makes one when you change an archive.
|
||||
|
||||
Several changes in the assembler were needed to have it generate the
|
||||
necessary output.
|
||||
A contextual diff follows. You can apply them as follows:
|
||||
patch -d /usr/em/philips/mach/68000/as < READ_ME
|
||||
|
||||
*** comm0.h.old Thu Dec 6 16:18:39 1984
|
||||
--- comm0.h Thu Dec 6 17:49:51 1984
|
||||
***************
|
||||
*** 213,218
|
||||
|
||||
/*
|
||||
* extra type bits out of S_ETC, internal use only
|
||||
* S_COM:
|
||||
* - symbols declared by .comm
|
||||
* S_VAR:
|
||||
|
||||
--- 213,219 -----
|
||||
|
||||
/*
|
||||
* extra type bits out of S_ETC, internal use only
|
||||
+ #ifndef DUK
|
||||
* S_COM:
|
||||
* - symbols declared by .comm
|
||||
#endif DUK
|
||||
***************
|
||||
*** 215,220
|
||||
* extra type bits out of S_ETC, internal use only
|
||||
* S_COM:
|
||||
* - symbols declared by .comm
|
||||
* S_VAR:
|
||||
* - type not known at end of PASS_1 (S_VAR|S_UND)
|
||||
* - value not known at end of PASS_2 (S_VAR|S_ABS)
|
||||
|
||||
--- 216,222 -----
|
||||
#ifndef DUK
|
||||
* S_COM:
|
||||
* - symbols declared by .comm
|
||||
+ #endif DUK
|
||||
* S_VAR:
|
||||
* - type not known at end of PASS_1 (S_VAR|S_UND)
|
||||
* - value not known at end of PASS_2 (S_VAR|S_ABS)
|
||||
***************
|
||||
*** 221,226
|
||||
* S_DOT:
|
||||
* - dot expression
|
||||
*/
|
||||
#define S_COM 0x0100
|
||||
#define S_VAR 0x0200
|
||||
#define S_DOT 0x0400
|
||||
|
||||
--- 223,229 -----
|
||||
* S_DOT:
|
||||
* - dot expression
|
||||
*/
|
||||
+ #ifndef DUK
|
||||
#define S_COM 0x0100
|
||||
#endif DUK
|
||||
#define S_VAR 0x0200
|
||||
***************
|
||||
*** 222,227
|
||||
* - dot expression
|
||||
*/
|
||||
#define S_COM 0x0100
|
||||
#define S_VAR 0x0200
|
||||
#define S_DOT 0x0400
|
||||
/* should be tested by preprocessor
|
||||
|
||||
--- 225,231 -----
|
||||
*/
|
||||
#ifndef DUK
|
||||
#define S_COM 0x0100
|
||||
+ #endif DUK
|
||||
#define S_VAR 0x0200
|
||||
#define S_DOT 0x0400
|
||||
/* should be tested by preprocessor
|
||||
*** comm2.y.old Thu Dec 6 16:19:07 1984
|
||||
--- comm2.y Thu Dec 6 16:02:19 1984
|
||||
***************
|
||||
*** 229,234
|
||||
{
|
||||
#ifdef RELOCATION
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
newrelo($1.typ, (int)$<y_word>0);
|
||||
#endif
|
||||
emitx($1.val, (int)$<y_word>0);
|
||||
|
||||
--- 229,239 -----
|
||||
{
|
||||
#ifdef RELOCATION
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
+ #ifdef DUK
|
||||
+ newrelo($1.typ,
|
||||
+ (int)$<y_word>0 | RELBR | RELWR
|
||||
+ );
|
||||
+ #else DUK
|
||||
newrelo($1.typ, (int)$<y_word>0);
|
||||
#endif DUK
|
||||
#endif
|
||||
***************
|
||||
*** 230,235
|
||||
#ifdef RELOCATION
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
newrelo($1.typ, (int)$<y_word>0);
|
||||
#endif
|
||||
emitx($1.val, (int)$<y_word>0);
|
||||
}
|
||||
|
||||
--- 235,241 -----
|
||||
);
|
||||
#else DUK
|
||||
newrelo($1.typ, (int)$<y_word>0);
|
||||
+ #endif DUK
|
||||
#endif
|
||||
emitx($1.val, (int)$<y_word>0);
|
||||
}
|
||||
***************
|
||||
*** 237,242
|
||||
{
|
||||
#ifdef RELOCATION
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
newrelo($3.typ, (int)$<y_word>0);
|
||||
#endif
|
||||
emitx($3.val, (int)$<y_word>0);
|
||||
|
||||
--- 243,253 -----
|
||||
{
|
||||
#ifdef RELOCATION
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
+ #ifdef DUK
|
||||
+ newrelo($3.typ,
|
||||
+ (int)$<y_word>0 | RELBR | RELWR
|
||||
+ );
|
||||
+ #else DUK
|
||||
newrelo($3.typ, (int)$<y_word>0);
|
||||
#endif DUK
|
||||
#endif
|
||||
***************
|
||||
*** 238,243
|
||||
#ifdef RELOCATION
|
||||
if (rflag != 0 && PASS_RELO)
|
||||
newrelo($3.typ, (int)$<y_word>0);
|
||||
#endif
|
||||
emitx($3.val, (int)$<y_word>0);
|
||||
}
|
||||
|
||||
--- 249,255 -----
|
||||
);
|
||||
#else DUK
|
||||
newrelo($3.typ, (int)$<y_word>0);
|
||||
+ #endif DUK
|
||||
#endif
|
||||
emitx($3.val, (int)$<y_word>0);
|
||||
}
|
||||
*** comm3.c.old Wed Jul 11 09:22:24 1984
|
||||
--- comm3.c Fri Dec 7 13:06:26 1984
|
||||
***************
|
||||
*** 11,16
|
||||
|
||||
struct outhead outhead = {
|
||||
O_MAGIC, O_STAMP, 0
|
||||
#ifdef BYTES_REVERSED
|
||||
| HF_BREV
|
||||
#endif
|
||||
|
||||
--- 11,17 -----
|
||||
|
||||
struct outhead outhead = {
|
||||
O_MAGIC, O_STAMP, 0
|
||||
+ #ifndef DUK
|
||||
#ifdef BYTES_REVERSED
|
||||
| HF_BREV
|
||||
#endif
|
||||
***************
|
||||
*** 17,22
|
||||
#ifdef WORDS_REVERSED
|
||||
| HF_WREV
|
||||
#endif
|
||||
};
|
||||
|
||||
#include "y.tab.h"
|
||||
|
||||
--- 18,24 -----
|
||||
#ifdef WORDS_REVERSED
|
||||
| HF_WREV
|
||||
#endif
|
||||
+ #endif DUK
|
||||
};
|
||||
|
||||
#include "y.tab.h"
|
||||
*** comm5.c.old Thu Dec 6 16:19:40 1984
|
||||
--- comm5.c Thu Oct 11 14:03:27 1984
|
||||
***************
|
||||
*** 162,167
|
||||
#endif
|
||||
case STRING:
|
||||
p = stringbuf;
|
||||
*p++ = n = getc(tempfile); break;
|
||||
case OP_EQ:
|
||||
case OP_NE:
|
||||
|
||||
--- 162,172 -----
|
||||
#endif
|
||||
case STRING:
|
||||
p = stringbuf;
|
||||
+ #ifdef DUK
|
||||
+ *p++ = n = getc(tempfile);
|
||||
+ p[n] = '\0';
|
||||
+ break;
|
||||
+ #else DUK
|
||||
*p++ = n = getc(tempfile); break;
|
||||
#endif DUK
|
||||
case OP_EQ:
|
||||
***************
|
||||
*** 163,168
|
||||
case STRING:
|
||||
p = stringbuf;
|
||||
*p++ = n = getc(tempfile); break;
|
||||
case OP_EQ:
|
||||
case OP_NE:
|
||||
case OP_LE:
|
||||
|
||||
--- 168,174 -----
|
||||
break;
|
||||
#else DUK
|
||||
*p++ = n = getc(tempfile); break;
|
||||
+ #endif DUK
|
||||
case OP_EQ:
|
||||
case OP_NE:
|
||||
case OP_LE:
|
||||
***************
|
||||
*** 354,359
|
||||
break;
|
||||
if (c == '\\')
|
||||
c = inescape();
|
||||
if (p >= &stringbuf[STRINGMAX])
|
||||
fatal("string buffer overflow");
|
||||
*p++ = c;
|
||||
|
||||
--- 360,368 -----
|
||||
break;
|
||||
if (c == '\\')
|
||||
c = inescape();
|
||||
+ #ifdef DUK
|
||||
+ if (p >= &stringbuf[STRINGMAX - 1])
|
||||
+ #else DUK
|
||||
if (p >= &stringbuf[STRINGMAX])
|
||||
#endif DUK
|
||||
fatal("string buffer overflow");
|
||||
***************
|
||||
*** 355,360
|
||||
if (c == '\\')
|
||||
c = inescape();
|
||||
if (p >= &stringbuf[STRINGMAX])
|
||||
fatal("string buffer overflow");
|
||||
*p++ = c;
|
||||
}
|
||||
|
||||
--- 364,370 -----
|
||||
if (p >= &stringbuf[STRINGMAX - 1])
|
||||
#else DUK
|
||||
if (p >= &stringbuf[STRINGMAX])
|
||||
+ #endif DUK
|
||||
fatal("string buffer overflow");
|
||||
*p++ = c;
|
||||
}
|
||||
***************
|
||||
*** 359,364
|
||||
*p++ = c;
|
||||
}
|
||||
stringbuf[0] = p - stringbuf - 1;
|
||||
return(STRING);
|
||||
}
|
||||
|
||||
|
||||
--- 369,377 -----
|
||||
*p++ = c;
|
||||
}
|
||||
stringbuf[0] = p - stringbuf - 1;
|
||||
+ #ifdef DUK
|
||||
+ *p = '\0';
|
||||
+ #endif DUK
|
||||
return(STRING);
|
||||
}
|
||||
|
||||
*** comm6.c.old Thu Dec 6 16:20:22 1984
|
||||
--- comm6.c Wed Oct 3 15:59:31 1984
|
||||
***************
|
||||
*** 106,111
|
||||
sp = §[typ - S_MIN];
|
||||
sp->s_item = ip;
|
||||
sp->s_lign = ALIGNSECT;
|
||||
ip->i_type = typ | S_EXT;
|
||||
ip->i_valu = 0;
|
||||
} else if (typ >= S_MIN) {
|
||||
|
||||
--- 106,114 -----
|
||||
sp = §[typ - S_MIN];
|
||||
sp->s_item = ip;
|
||||
sp->s_lign = ALIGNSECT;
|
||||
+ #ifdef DUK
|
||||
+ ip->i_type = typ;
|
||||
+ #else DUK
|
||||
ip->i_type = typ | S_EXT;
|
||||
#endif DUK
|
||||
ip->i_valu = 0;
|
||||
***************
|
||||
*** 107,112
|
||||
sp->s_item = ip;
|
||||
sp->s_lign = ALIGNSECT;
|
||||
ip->i_type = typ | S_EXT;
|
||||
ip->i_valu = 0;
|
||||
} else if (typ >= S_MIN) {
|
||||
sp = §[typ - S_MIN];
|
||||
|
||||
--- 110,116 -----
|
||||
ip->i_type = typ;
|
||||
#else DUK
|
||||
ip->i_type = typ | S_EXT;
|
||||
+ #endif DUK
|
||||
ip->i_valu = 0;
|
||||
} else if (typ >= S_MIN) {
|
||||
sp = §[typ - S_MIN];
|
||||
***************
|
||||
*** 180,185
|
||||
* for possible relocation
|
||||
*/
|
||||
ip->i_valu = outhead.oh_nname;
|
||||
newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
--- 184,192 -----
|
||||
* for possible relocation
|
||||
*/
|
||||
ip->i_valu = outhead.oh_nname;
|
||||
+ #ifdef DUK
|
||||
+ newsymb(ip->i_name, S_COM|S_EXT|DOTTYP, (short)0, val);
|
||||
+ #else DUK
|
||||
newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
|
||||
#endif DUK
|
||||
#endif
|
||||
***************
|
||||
*** 181,186
|
||||
*/
|
||||
ip->i_valu = outhead.oh_nname;
|
||||
newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
--- 188,194 -----
|
||||
newsymb(ip->i_name, S_COM|S_EXT|DOTTYP, (short)0, val);
|
||||
#else DUK
|
||||
newsymb(ip->i_name, S_EXT|DOTTYP, (short)0, val);
|
||||
+ #endif DUK
|
||||
#endif
|
||||
}
|
||||
|
||||
***************
|
||||
*** 255,260
|
||||
short s;
|
||||
{
|
||||
struct outrelo outrelo;
|
||||
|
||||
if (rflag == 0)
|
||||
return;
|
||||
|
||||
--- 263,271 -----
|
||||
short s;
|
||||
{
|
||||
struct outrelo outrelo;
|
||||
+ #ifdef DUK
|
||||
+ int iscomm;
|
||||
+ #endif DUK
|
||||
|
||||
if (rflag == 0)
|
||||
return;
|
||||
***************
|
||||
*** 272,277
|
||||
* b=a
|
||||
* a: .data2 0
|
||||
*/
|
||||
s &= ~S_COM;
|
||||
if ((n & RELPC) == 0 && s == S_ABS)
|
||||
return;
|
||||
|
||||
--- 283,291 -----
|
||||
* b=a
|
||||
* a: .data2 0
|
||||
*/
|
||||
+ #ifdef DUK
|
||||
+ iscomm = s & S_COM;
|
||||
+ #endif DUK
|
||||
s &= ~S_COM;
|
||||
if ((n & RELPC) == 0 && s == S_ABS)
|
||||
return;
|
||||
***************
|
||||
*** 285,290
|
||||
outrelo.or_type = (char)n;
|
||||
outrelo.or_sect = (char)DOTTYP;
|
||||
#ifndef ASLD
|
||||
if (s == S_UND) {
|
||||
assert(relonami != 0);
|
||||
outrelo.or_nami = relonami-1;
|
||||
|
||||
--- 299,307 -----
|
||||
outrelo.or_type = (char)n;
|
||||
outrelo.or_sect = (char)DOTTYP;
|
||||
#ifndef ASLD
|
||||
+ #ifdef DUK
|
||||
+ if (s == S_UND || iscomm) {
|
||||
+ #else DUK
|
||||
if (s == S_UND) {
|
||||
#endif DUK
|
||||
assert(relonami != 0);
|
||||
***************
|
||||
*** 286,291
|
||||
outrelo.or_sect = (char)DOTTYP;
|
||||
#ifndef ASLD
|
||||
if (s == S_UND) {
|
||||
assert(relonami != 0);
|
||||
outrelo.or_nami = relonami-1;
|
||||
relonami = 0;
|
||||
|
||||
--- 303,309 -----
|
||||
if (s == S_UND || iscomm) {
|
||||
#else DUK
|
||||
if (s == S_UND) {
|
||||
+ #endif DUK
|
||||
assert(relonami != 0);
|
||||
outrelo.or_nami = relonami-1;
|
||||
relonami = 0;
|
||||
*** comm7.c.old Thu Dec 6 16:20:50 1984
|
||||
--- comm7.c Wed Oct 3 16:35:31 1984
|
||||
***************
|
||||
*** 19,24
|
||||
return(ip->i_valu);
|
||||
return(ip->i_valu + sect[typ].s_base);
|
||||
#else
|
||||
if ((ip->i_type & S_TYP) == S_UND) {
|
||||
if (pass == PASS_3) {
|
||||
if (relonami != 0)
|
||||
|
||||
--- 19,27 -----
|
||||
return(ip->i_valu);
|
||||
return(ip->i_valu + sect[typ].s_base);
|
||||
#else
|
||||
+ #ifdef DUK
|
||||
+ if ((ip->i_type & S_TYP) == S_UND || (ip->i_type & S_COM)) {
|
||||
+ #else DUK
|
||||
if ((ip->i_type & S_TYP) == S_UND) {
|
||||
#endif DUK
|
||||
if (pass == PASS_3) {
|
||||
***************
|
||||
*** 20,25
|
||||
return(ip->i_valu + sect[typ].s_base);
|
||||
#else
|
||||
if ((ip->i_type & S_TYP) == S_UND) {
|
||||
if (pass == PASS_3) {
|
||||
if (relonami != 0)
|
||||
serror("relocation error");
|
||||
|
||||
--- 23,29 -----
|
||||
if ((ip->i_type & S_TYP) == S_UND || (ip->i_type & S_COM)) {
|
||||
#else DUK
|
||||
if ((ip->i_type & S_TYP) == S_UND) {
|
||||
+ #endif DUK
|
||||
if (pass == PASS_3) {
|
||||
if (relonami != 0)
|
||||
serror("relocation error");
|
||||
*** mach0.c.old Thu Dec 6 16:21:11 1984
|
||||
--- mach0.c Fri Sep 14 14:15:54 1984
|
||||
***************
|
||||
*** 1,3
|
||||
/* @(#)mach0.c 1.5 */
|
||||
/*
|
||||
* Motorola 68000/68010 options
|
||||
|
||||
--- 1,4 -----
|
||||
+ #define DUK
|
||||
/* @(#)mach0.c 1.5 */
|
||||
/*
|
||||
* Motorola 68000/68010 options
|
||||
*** mach4.c.old Thu Dec 6 16:21:30 1984
|
||||
--- mach4.c Thu Dec 6 16:05:00 1984
|
||||
***************
|
||||
*** 21,26
|
||||
fit(fitw($4.val));
|
||||
emit2($1 | $2);
|
||||
#ifdef RELOCATION
|
||||
newrelo($4.typ, RELPC|RELO2);
|
||||
#endif
|
||||
emit2(loww($4.val));
|
||||
|
||||
--- 21,29 -----
|
||||
fit(fitw($4.val));
|
||||
emit2($1 | $2);
|
||||
#ifdef RELOCATION
|
||||
+ #ifdef DUK
|
||||
+ newrelo($4.typ, RELPC|RELO2|RELBR|RELWR);
|
||||
+ #else DUK
|
||||
newrelo($4.typ, RELPC|RELO2);
|
||||
#endif DUK
|
||||
#endif
|
||||
***************
|
||||
*** 22,27
|
||||
emit2($1 | $2);
|
||||
#ifdef RELOCATION
|
||||
newrelo($4.typ, RELPC|RELO2);
|
||||
#endif
|
||||
emit2(loww($4.val));
|
||||
}
|
||||
|
||||
--- 25,31 -----
|
||||
newrelo($4.typ, RELPC|RELO2|RELBR|RELWR);
|
||||
#else DUK
|
||||
newrelo($4.typ, RELPC|RELO2);
|
||||
+ #endif DUK
|
||||
#endif
|
||||
emit2(loww($4.val));
|
||||
}
|
||||
*** mach5.c.old Thu Dec 6 16:21:54 1984
|
||||
--- mach5.c Thu Dec 6 16:07:05 1984
|
||||
***************
|
||||
*** 37,42
|
||||
#ifdef RELOCATION
|
||||
RELOMOVE(relonami, rel_1);
|
||||
if (flag & ~0xFF)
|
||||
newrelo(exp_1.typ, flag>>8);
|
||||
#endif
|
||||
if (flag & PUTL)
|
||||
|
||||
--- 37,45 -----
|
||||
#ifdef RELOCATION
|
||||
RELOMOVE(relonami, rel_1);
|
||||
if (flag & ~0xFF)
|
||||
+ #ifdef DUK
|
||||
+ newrelo(exp_1.typ, (flag>>8) | RELBR | RELWR);
|
||||
+ #else DUK
|
||||
newrelo(exp_1.typ, flag>>8);
|
||||
#endif DUK
|
||||
#endif
|
||||
***************
|
||||
*** 38,43
|
||||
RELOMOVE(relonami, rel_1);
|
||||
if (flag & ~0xFF)
|
||||
newrelo(exp_1.typ, flag>>8);
|
||||
#endif
|
||||
if (flag & PUTL)
|
||||
emit4(exp_1.val);
|
||||
|
||||
--- 41,47 -----
|
||||
newrelo(exp_1.typ, (flag>>8) | RELBR | RELWR);
|
||||
#else DUK
|
||||
newrelo(exp_1.typ, flag>>8);
|
||||
+ #endif DUK
|
||||
#endif
|
||||
if (flag & PUTL)
|
||||
emit4(exp_1.val);
|
||||
***************
|
||||
*** 357,362
|
||||
fit(fitw(exp.val));
|
||||
emit2(opc);
|
||||
#ifdef RELOCATION
|
||||
newrelo(exp.typ, RELPC|RELO2);
|
||||
#endif
|
||||
emit2(loww(exp.val));
|
||||
|
||||
--- 361,369 -----
|
||||
fit(fitw(exp.val));
|
||||
emit2(opc);
|
||||
#ifdef RELOCATION
|
||||
+ #ifdef DUK
|
||||
+ newrelo(exp.typ, RELPC|RELO2|RELBR|RELWR);
|
||||
+ #else DUK
|
||||
newrelo(exp.typ, RELPC|RELO2);
|
||||
#endif DUK
|
||||
#endif
|
||||
***************
|
||||
*** 358,363
|
||||
emit2(opc);
|
||||
#ifdef RELOCATION
|
||||
newrelo(exp.typ, RELPC|RELO2);
|
||||
#endif
|
||||
emit2(loww(exp.val));
|
||||
}
|
||||
|
||||
--- 365,371 -----
|
||||
newrelo(exp.typ, RELPC|RELO2|RELBR|RELWR);
|
||||
#else DUK
|
||||
newrelo(exp.typ, RELPC|RELO2);
|
||||
+ #endif DUK
|
||||
#endif
|
||||
emit2(loww(exp.val));
|
||||
}
|
||||
72
util/led/WRONG
Normal file
72
util/led/WRONG
Normal file
@@ -0,0 +1,72 @@
|
||||
This file contains a summary of the bugs/features/inconsistencies
|
||||
Robbert and Ed found while making the linker usable for the 68000 and amoeba.
|
||||
|
||||
There is something wrong with the way the combination of
|
||||
assembler and linker handle bss.
|
||||
In the original (Duk's) the assembler translated .space and, worse, .align
|
||||
to a sequence of zero's. If this sequence was at the end of a segment
|
||||
within a module the assembler didn't put zero in the segment but sets
|
||||
os_flen to the amount of space initialized before the zero space
|
||||
and os_size to the segements size. (os_size - os_flen) is then the
|
||||
size of the space filled by zeroes.
|
||||
For the sake of clarity, let us call 0...os_flen-1 initialized space
|
||||
and os_flen..os_size-1 uninitialized space.
|
||||
Now the linker, it does a nasty trick. It gathers the uninitialized space
|
||||
of all modules within a segment and puts it consequtively at the end
|
||||
of the segment. I think that I understand the reason: This way you can keep
|
||||
your resultant a.out smaller and you don't need a special bss segment
|
||||
(a la unix). But it is incorrect, the net effect is that the .align's
|
||||
at the end of segments within a module do have the desired effect,
|
||||
the space thus allocated is removed to 'higher spheres' thereby
|
||||
leaving the first items of that segment in the inmediatly following
|
||||
modules at unaligned boundaries.
|
||||
What should be done is that the linker leaves the initialized and
|
||||
the unitialized code alone and regards the whole a a chunk that can be
|
||||
relocated. Only producing a difference of os_size and os_flen for
|
||||
the zeroes at the very end of the segment. Thereby collapsing all
|
||||
.space (and .align) commands into zero space only if they
|
||||
are in consequtive modules at the end of the segment, with modules
|
||||
NOT containing any initialized data.
|
||||
I already, ad-hoc, changed the code of the assembler to producing 'hard'
|
||||
zeroes when aligning. The trick could also be done for .space
|
||||
but is a bit harder here.
|
||||
The reason: .space is also used to allocate space in the BSS segment
|
||||
if that produced zeroes in the a.out file (0..bss_size) we would
|
||||
have a.out files that are far too large.
|
||||
This feature of the linker also caused weird effects for names that
|
||||
are defined as the very last in a section within a module, without
|
||||
any data (initialized or uninitialezed) after it.
|
||||
The names a regarded as pointing into the uninitialized space and
|
||||
thus relocated to the end of the section.
|
||||
The sequence
|
||||
.sect .data
|
||||
begdata:
|
||||
.sect ....
|
||||
in an head_em.s resulted in the relocation of begdata to the END
|
||||
of the .data segment.
|
||||
|
||||
Another problem form the commons:
|
||||
1 - Local commons are not handled by led and not produced by as.
|
||||
using .comm for unitialized data is not correct because (from C)
|
||||
two uninitialized static declarations for the same name in
|
||||
different modules will be handled as external commons and thus
|
||||
be overlayed.
|
||||
2 - The commons are allocated at the very end of the first pass, after the
|
||||
initialezed data has been allocated in the segments. The order on which
|
||||
the commons are allocated seems to be random. That way it is impossible
|
||||
to produce a label that is guaranteed to point to the last byte (+1)
|
||||
of a segment containing commons.
|
||||
The currently used trick is to declare an extra segment after the
|
||||
segment containing the commons. The first bytre in this segment
|
||||
inmediatly follows the commons and can be used as _end or endbss.
|
||||
|
||||
The archiver (aal) with the automatic ranlib is buggy.
|
||||
The only thing that seems to work at the moment is creation of a fresh
|
||||
archive.
|
||||
replacing/adding/deleting modules is likely to produce libraries
|
||||
with incorrect ranlib entries.
|
||||
The major troublemaker seems to be the extra padding byte at the end
|
||||
of odd sized modules.
|
||||
|
||||
Led should return a non-zero value when it has found Undefined symbols
|
||||
or has another reason for not being able to produce a correct output file.
|
||||
23
util/led/makedepend
Executable file
23
util/led/makedepend
Executable file
@@ -0,0 +1,23 @@
|
||||
: 'Without arguments, this program clears the dependencies between'
|
||||
: '.o files and included files in Makefile.'
|
||||
: 'With arguments, it replaces the dependencies between the .o files'
|
||||
: 'resulting from the argument files, and the included files in Makefile.'
|
||||
: 'Makefile must contain a line with on it the pattern AUTOAUTOAUTO.'
|
||||
: 'WARNING: a temporary file is created in the current directory.'
|
||||
: 'It is however rather unlikely that this file already exists'
|
||||
grep -s AUTOAUTOAUTO Makefile || {
|
||||
echo "Makefile has wrong format." 1>&2
|
||||
exit 1
|
||||
}
|
||||
for file do
|
||||
ofile=`echo $file | sed 's/.$/o/'`
|
||||
grep '^# *include.*"' $file | sed "s/.*\"\(.*\)\".*/$ofile: \1/"
|
||||
done | sort -u > @@**##$$
|
||||
echo "Non-empty line." >> Makefile
|
||||
ed - Makefile <<'!'
|
||||
/AUTOAUTOAUTO/+,$d
|
||||
w
|
||||
q
|
||||
!
|
||||
cat @@**##$$ >> Makefile
|
||||
rm -f @@**##$$
|
||||
Reference in New Issue
Block a user