I need this so I can add more %token lines to mach/powerpc/as/mach2.c
The assembler's tempfile encoded each token in a byte. This only
worked with tokens 0 to 127 and 256 and 383. If a token 384 or higher
existed, the assembler stopped working. I need tokens 384 and higher.
I change the token encoding to a 2-byte little-endian integer. I also
change a byte in the string encoding.
---snip---
The ELF spec at http://www.sco.com/developers/gabi/ says, "In each
symbol table, all symbols with STB_LOCAL binding precede the weak and
global symbols," and that sh_info is the index of the first non-local
symbol.
I was mixing local and global symbols and setting sh_info to zero. I
also forgot to set the type of the .shstrtab section.
---snip---
See issue #1 (https://github.com/davidgiven/ack/issues/1). The file
mach/proto/as/comm2.y goes through cpp twice. The _include macro,
defined in comm2.y and used in comm0.h, delays the inclusion of system
header files. The inclusion of <stdint.h> wasn't delayed. This
caused multiple inclusions of <sys/_types.h> in FreeBSD and
<machine/_types.h> in OpenBSD.
Use _include to delay <stdint.h>. Also use _include for "arch.h" and
"out.h", because h/out.h includes <stdint.h> and h/arch.h might
include it in the future.
Sort the system includes in comm0.h by moving them up to be with
<stdint.h>. Must include <stdint.h> before "mach0.c", because
mach/powerpc/as/mach0.c needs it. Must include "mach0.c" before
checking ASLD.
In my OpenBSD/amd64 system, the code becomes
if (0)
outname.on_valu &= ~(((0xFFFFFFFF)<<32)<<32);
The 0xFFFFFFFF is a 32-bit int, so the left shift by 32 is out of
range and causes the gcc warning.
The intent might be to clear any sign-extended bits, if the assignment
outname.on_valu = valu did sign extension. Old C had no unsigned
long, so .on_valu would have been long. The code is obsolete because
h/out.h now declares .on_valu as uint32_t.
possible values. Add the PowerPC ncg and mcg backend support to let the test
actually run, including modifying a bunch of PowrePC libem functions so that
they can be called from both ncg and mcg.
assembler directives, ha16() and has16(), for the upper half; has16() applies
the sign adjustment. .powerpcfixup is now gone, as we generate the relocation
in ha*() instead. Add special logic to the linker for undoing and redoing the
sign adjustment when reading/writing fixups. Tests still pass.