Re: [PATCH] ld: Account for .tbss size on ARM EABI targets

Torbjorn SVENSSON <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>

On 2026-08-19 05:57, Hans-Peter Nilsson wrote:
> Drive-by reviewing:
> 
> On Tue, 18 Aug 2026, Torbjörn SVENSSON wrote:
> 
>> Ok for master?
>>
>> --
>>
>> Bare-metal ARM EABI programs allocate TLS storage directly, so if .tdata
>> consumses VMA, then .tbss must also do so.  Otherwise, a following
>> section such as .bss can overlap it.
>>
>> Keep the existing behavior for non-EABI targets, and add tests for
>> static, executable, PIE, and dynamic links.
>>
>> This change aligns with LLVM lld behavior for .tbss.
> 
>> +++ b/ld/emultempl/armelf.em
>> @@ -58,6 +58,7 @@ gld${EMULATION_NAME}_before_parse (void)
>>   #endif /* not TARGET_ */
>>     input_flags.dynamic = ${DYNAMIC_LINK-true};
>>     config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
>> +  config.tls_nobits_occupies_vma = `case ${target} in arm*-*-eabi*) echo true ;; *) echo false ;; esac`;
> 
> Can $target be "thumb" here, so it'd make sense to have the
> pattern instead be "*-*-eabi*"?
> 
> (Not a rhetorical question, if $target is somehow canonicalized
> to "arm" and a lone "*-*-eabi*" would look out of place here
> rather than obviously safe.)

I've never seen any "thumb" target like that, and greping the sources only gives me hits in changelog entries.
Is this some old relic or is it actually used these days?

In the GCC sources, I see that thumb-*-* is listed as "not supported".

Do you still think I should add 'thumb*-*-eabi*" or something similar?

Kind regards,
Torbjörn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.