From bae2e52bfd676c447862b9baec535db401aab075 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 23 Feb 2012 21:24:56 -0500 Subject: cleanup and work around visibility bug in gcc 3 that affects x86_64 in gcc 3, the visibility attribute must be placed on both the declaration and on the definition. if it's omitted from the definition, the compiler fails to emit the ".hidden" directive in the assembly, and the linker will either generate textrels (if supported, such as on i386) or refuse to link (on targets where certain types of textrels are forbidden or impossible without further assumptions about memory layout, such as on x86_64). this patch also unifies the decision about when to use visibility into libc.h and makes the visibility in the utf-8 state machine tables based on libc.h rather than a duplicate test. --- src/multibyte/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/multibyte/internal.c') diff --git a/src/multibyte/internal.c b/src/multibyte/internal.c index 11b9818f..1a4ddc3f 100644 --- a/src/multibyte/internal.c +++ b/src/multibyte/internal.c @@ -23,7 +23,7 @@ | ( R(0x80,0xc0) >> 12 ) \ | x ) -const uint32_t bittab[] = { +const uint32_t bittab[] ATTR_LIBC_VISIBILITY = { C(0x2),C(0x3),C(0x4),C(0x5),C(0x6),C(0x7), C(0x8),C(0x9),C(0xa),C(0xb),C(0xc),C(0xd),C(0xe),C(0xf), D(0x0),D(0x1),D(0x2),D(0x3),D(0x4),D(0x5),D(0x6),D(0x7), -- cgit v1.2.1