Displaying 5 results from an estimated 5 matches for "__stdout_used".
2013 Jan 09
2
[LLVMdev] [lld] ELF weak aliases
...i Michael,
>
> Does ELF support aliasing ?
>
> How is the relationship captured in ELF symbol table, that one symbol is a
> alias of another symbol ?
It is not explicitly captured. It's an implicit relationship due to
the symbols having the same address.
>
>> Note that __stdout_used is the last symbol in the .rodata section.
>> This means that the reader assigns the data (16 bytes of 0) to
>> __stdout_used. Because dummy_file and the other __stdx_used symbols
>> come before it, they end up in the right place in the final file.
>
> Did you change the Rea...
2013 Jan 09
0
[LLVMdev] [lld] ELF weak aliases
Hi Michael,
Does ELF support aliasing ?
How is the relationship captured in ELF symbol table, that one symbol is a
alias of another symbol ?
> Note that __stdout_used is the last symbol in the .rodata section.
> This means that the reader assigns the data (16 bytes of 0) to
> __stdout_used. Because dummy_file and the other __stdx_used symbols
> come before it, they end up in the right place in the final file.
Did you change the Reader too ?
The Reader...
2013 Jan 09
4
[LLVMdev] [lld] ELF weak aliases
...h musl
and lld. It did require one change to hack around incorrect handling
of ELF weak aliases.
In musl __stdio_exit.c
<http://git.musl-libc.org/cgit/musl/tree/src/stdio/__stdio_exit.c> we
have:
static FILE *const dummy_file = 0;
weak_alias(dummy_file, __stdin_used);
weak_alias(dummy_file, __stdout_used);
weak_alias(dummy_file, __stderr_used);
weak_alias(old, new) is defined as: extern __typeof(old) new
__attribute__((weak, alias(#old)))
This generates the following object file:
mspencer at mspencer-vm:~/Projects/test$ objdump -st
../musl/src/stdio/__stdio_exit.o
../musl/src/stdio/__stdio_exit....
2013 Jan 09
0
[LLVMdev] [lld] ELF weak aliases
...>> How is the relationship captured in ELF symbol table, that one symbol is
>> a
>> alias of another symbol ?
>
> It is not explicitly captured. It's an implicit relationship due to
> the symbols having the same address.
Got it.
>
>>
>>> Note that __stdout_used is the last symbol in the .rodata section.
>>> This means that the reader assigns the data (16 bytes of 0) to
>>> __stdout_used. Because dummy_file and the other __stdx_used symbols
>>> come before it, they end up in the right place in the final file.
>>
>> Di...
2013 Jan 09
0
[LLVMdev] [lld] ELF weak aliases
...hack around incorrect handling
> of ELF weak aliases.
>
> In musl __stdio_exit.c
> <http://git.musl-libc.org/cgit/musl/tree/src/stdio/__stdio_exit.c> we
> have:
>
> static FILE *const dummy_file = 0;
> weak_alias(dummy_file, __stdin_used);
> weak_alias(dummy_file, __stdout_used);
> weak_alias(dummy_file, __stderr_used);
>
> weak_alias(old, new) is defined as: extern __typeof(old) new
> __attribute__((weak, alias(#old)))
>
> This generates the following object file:
> mspencer at mspencer-vm:~/Projects/test$ objdump -st
> ../musl/src/stdio/__stdio...