-fdata-sections implies no .sdata

Geoff Keating geoffk@geoffk.org
Mon May 13 12:33:00 GMT 2002


Andreas Schwab <schwab@suse.de> writes:

> When -fdata-sections is in effect then small data never goes to .sdata, so
> we cannot use @gprel.  Since ia64_encode_section_info is called before
> resolve_unique_sections it must check flag_data_sections itself.

That's a bug somewhere else.  Small data should go into .sdata.<varname>,
which ends up in .sdata due to linker scripts.

> Andreas.
> 
> 2002-05-13  Andreas Schwab  <schwab@suse.de>
> 
> 	* config/ia64/ia64.c (ia64_encode_section_info): Handle
> 	-fdata-sections.
> 
> --- gcc/config/ia64/ia64.c.~1.139.2.15.~	2002-04-19 11:03:03.000000000 +0200
> +++ gcc/config/ia64/ia64.c	2002-05-13 16:10:52.000000000 +0200
> @@ -6909,10 +6909,12 @@ ia64_encode_section_info (decl)
>        /* Either the variable must be declared without a section attribute,
>  	 or the section must be sdata or sbss.  */
>        && (DECL_SECTION_NAME (decl) == 0
> -	  || ! strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
> +	  /* -fdata-sections has not been considered yet.  */
> +	  ? ! flag_data_sections
> +	  : (! strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
>  		       ".sdata")
> -	  || ! strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
> -		       ".sbss")))
> +	     || ! strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
> +			  ".sbss"))))
>      {
>        HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl));
>  
> 
> -- 
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
> Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>



More information about the Gcc-patches mailing list