Blame src/general/tls_align_dso.c

nsz 462b4f
__thread char      c1 = 1;
nsz 462b4f
__thread char      xchar = 2;
nsz 462b4f
__thread char      c2 = 3;
nsz 462b4f
__thread short     xshort = 4;
nsz 462b4f
__thread char      c3 = 5;
nsz 462b4f
__thread int       xint = 6;
nsz 462b4f
__thread char      c4 = 7;
nsz 462b4f
__thread long long xllong = 8;
nsz 462b4f
nsz 462b4f
struct {
nsz 462b4f
	char *name;
nsz cdfd9b
	unsigned size;
nsz cdfd9b
	unsigned align;
nsz cdfd9b
	unsigned long addr;
nsz 462b4f
} t[4];
nsz 462b4f
nsz 462b4f
#define entry(i,x) \
nsz 462b4f
	t[i].name = #x; \
nsz 462b4f
	t[i].size = sizeof x; \
nsz 462b4f
	t[i].align = __alignof__(x); \
nsz cdfd9b
	t[i].addr = (unsigned long)&x;
nsz 462b4f
nsz 462b4f
__attribute__((constructor)) static void init(void)
nsz 462b4f
{
nsz 462b4f
	entry(0, xchar)
nsz 462b4f
	entry(1, xshort)
nsz 462b4f
	entry(2, xint)
nsz 462b4f
	entry(3, xllong)
nsz 462b4f
}
nsz 462b4f