On 1 June 2013 14:06, Jan Hubicka <hubi...@ucw.cz> wrote: > Hi, > this patch cleanups way we handle aliases. The main point is to merge code > that was previously done separately for variables and functions. >
Hello, This patch appears to break both arm and aarch64. I don't fully understand the mechanism. The issue shows up when building res_libc.o over in glibc. The following fragment demonstrates the issue: /* aarch64-none-linux-gnueabi-gcc -O2 -c -std=gnu99 -fgnu89-inline r.c */ struct __res_state { int retrans; }; extern __thread struct __res_state *__libc_resp __attribute__ ((tls_model ("initial-exec"))); struct __res_state _res __attribute__((section (".bss"))); __thread struct __res_state *__resp = &_res; extern __thread struct __res_state *__libc_resp __attribute__ ((alias ("__resp"))) ; int __res_init(void) { (*__libc_resp).retrans = 5; } We seem to lose track of the alias between _resp and __llbc_resp resulting in the following output: .size __res_init, .-__res_init .global __resp .global __libc_resp __libc_resp = __resp .global _res .section .bss,"aw",%nobits .align 3 .type _res, %object .size _res, 4 _res: .zero 4 .section .tbss,"awT",%nobits .align 3 .LANCHOR0 = . + 0 .type __libc_resp, %object .size __libc_resp, 8 __libc_resp: .zero 8 .section .tdata,"awT",%progbits .align 3 .type __resp, %object .size __resp, 8 __resp: .xword _res Note the definition of both __libc_resp and __resp, where previously we would have defined only __resp. I suspect the section anchor appeared because varasm.c:use_blocks_for_decl_p test for an 'alias' failed. /Marcus