git : errno and thread weirdness
matthieu castet
castet.matthieu at free.fr
Sun Dec 20 10:39:01 UTC 2009
Hi,
matthieu castet a écrit :
> Austin Foxley a écrit :
>> On 12/19/2009 04:39 PM, matthieu castet wrote:
>>>
>>> Removing the libc_hidden_weak/libc_hidden_proto for __errno_location and
>>> __h_errno_location make the things work. [1]
>>>
>>>
>>> Is that normal ?
>>
>> What arch are you on? What's your .config?
>>
> [1] there other issue. Work example a static link of [2], crash because
> _stdio_init is NULL, but because _stdio_init is HIDDEN, gcc remove the
> check.
> making not hidden make it crash on _stdio_term that is also hidden.
> I am missing something or uclibc git doesn't work at all ?
>
>
here a small test case :
$cat /tmp/test.c
# define attribute_hidden __attribute__ ((visibility ("hidden")))
# define weak_function __attribute__ ((weak))
extern void weak_function _stdio_init(void) attribute_hidden;
int main()
{
if (_stdio_init)
_stdio_init();
return 0;
}
$gcc /tmp/test.c -o /tmp/test -fno-strict-aliasing -funsigned-char -fno-builtin -fno-asm -std=gnu99 -ffunction-sections -fdata-sections -m32 -fno-stack-protector -nostdinc -Os -funit-at-a-time -fmerge-all-constants -fno-tree-loop-optimize -fno-tree-dominator-opts -fno-strength-reduce -fomit-frame-pointer -mpreferred-stack-boundary=4 -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -fPIC -fno-stack-protector -g
$/tmp/test
Segmentation fault
disassembling code :
0x08048394 <main+0>: lea 0x4(%esp),%ecx
0x08048398 <main+4>: and $0xfffffff0,%esp
0x0804839b <main+7>: pushl -0x4(%ecx)
0x0804839e <main+10>: push %ebx
0x0804839f <main+11>: push %ecx
0x080483a0 <main+12>: sub $0x4,%esp
0x080483a3 <main+15>: call 0x0
0x080483a8 <main+20>: xor %eax,%eax
0x080483aa <main+22>: pop %edx
0x080483ab <main+23>: pop %ecx
0x080483ac <main+24>: pop %ebx
0x080483ad <main+25>: lea -0x4(%ecx),%esp
0x080483b0 <main+28>: ret
More information about the uClibc
mailing list