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

Hans-Peter Nilsson <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
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.)

brgds, H-P
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.