[email protected] wrote:
struct {
unsigned long got_offset;
unsigned some_attribute:X;
rather unsigned char some_attribute:X; in that case. No need to waste more than
a byte.
<more ...>
} *symbol_attributes:
int nb_symbol_attributes;
It's fine for me. I was just concerned about tcc's memory usage. Shall I
proceed with the change you describe?
Well, why not. It doesn't cover yet consequent pass-trough of the
AttributeDef but it could be a step in the right direction.
I'd suggest changing
static void put_got_offset(TCCState *s1, int index, unsigned long val);
into a more general
static struct sym_attribute *get_sym_attribute(TCCState *s1, int index);
which would expand the array with an empty entry if needed.
Thus the currently single instance of usage
put_got_offset(s1, sym_index, s1->got->data_offset);
would become
get_sym_attribute(s1, sym_index)->got_offset = s1->got->data_offset;
Anyway, just my 2 cents of completely untested suggestions. ;)
--- grischka
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel