[PATCH] ld.so: handle STT_COMMON symbols

Carmelo AMOROSO carmelo.amoroso at st.com
Mon Oct 8 13:48:36 UTC 2007


Joakim Tjernlund wrote:
> On Mon, 2007-10-08 at 14:01 +0200, Carmelo AMOROSO wrote:
>   
>> Joakim Tjernlund wrote:
>>     
>>> On Mon, 2007-10-08 at 12:15 +0200, Carmelo AMOROSO wrote:
>>>   
>>>       
>>>> Joakim Tjernlund wrote:
>>>>     
>>>>         
>>>>> On Mon, 2007-10-08 at 09:10 +0200, Carmelo AMOROSO wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> Hi Folks,
>>>>>> as reported into glibc bug #5104 
>>>>>> (http://sourceware.org/bugzilla/show_bug.cgi?id=5104)
>>>>>>
>>>>>>     
>>>>>>         
>>>>>>             
>>>>> [snip]
>>>>>   
>>>>> I am good with this change. One question though: I don't think the
>>>>> STT_SECTION and STT_FILE are present in a relocatable object. If this
>>>>> is true(needs to be checked), then the above if stmt can be changed to:
>>>>>  #define STT_RELOC_MAX STT_TLS
>>>>> or 
>>>>>  #define STT_RELOC_MAX STT_COMMON 
>>>>> if (ELF_ST_TYPE(sym->st_info) > STT_RELOC_MAX)
>>>>>
>>>>> or if the above assumption is true only for STT_FILE
>>>>> if (ELF_ST_TYPE(sym->st_info) > STT_RELOC_MAX || ELF_ST_TYPE(sym->st_info) == STT_SECTION)
>>>>>   
>>>>>       
>>>>>           
>>>> This is the case, STT_SECTION symbol are present into symbol table of 
>>>> the libuClibc.so.0 for sure.
>>>> Actually, I did not find any STT_FILE symbols...
>>>>     
>>>>         
>>> Right, but they are STB_LOCAL I think. If so they are skipped anyway.
>>>   
>>>       
>> Yes, they are STB_LOCAL, but we should skip them earlier to avoid 
>> calling a pointless strcmp... right?
>>     
>
> Yes, but their st_value *might* be 0. If so, then they
> are skipped anyway. Eeh, just noticed they are not 0.
>
>   
yes ;-)
> You might not hit the default: case in the switch stmt very often(or at
> all)
>
> Just trying to keep this function as clean/fast as possible. When TLS
> gets added it might get ugly. 
In the TLS case, it needs to add simply another check
&& ELF_ST_TYPE(sym->st_info) != STT_TLS
nothing special :-)
> Anyhow, I accept your orginal fix,
ok. When committed I'll send a message to the binutils ML to make them 
aware of
>  but if
> you want to experiment/reseach this issue you are most welcome :)
>
>  Jocke
>   
I'll see
Carmelo



More information about the uClibc mailing list