This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -fdata-sections implies no .sdata
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 13 May 2002 11:14:27 -0700
- Subject: Re: -fdata-sections implies no .sdata
- References: <jey9eo161e.fsf@sykes.suse.de>
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>