public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Yousef <gtatyous@gmail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Section pragmas
Date: Wed, 15 Apr 2020 08:15:27 +0200	[thread overview]
Message-ID: <CAFiYyc27Nnr5mtz38GMXAgKH_kv8zRmGvSa8soQbQ6sxY42ndA@mail.gmail.com> (raw)
In-Reply-To: <CA+REhszN5=9Vma9zr0Xn8YcHaxrf=5X4kz+mEp40y_T+iQTWzw@mail.gmail.com>

On Wed, Apr 15, 2020 at 1:22 AM Yousef via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hi
>
> I am very shocked to find out that GCC GNU does not support section
> pragams. I have to declare an attribute for every single variable and
> function for hundreds of files where I can just use few pragmas on other
> compilers.
>
> I do not understand why would GNU discourage the use of pragmas where they
> can be so useful. I understand that I can use linked scripts but that
> requires organization of object files and for a lot of cases it is much
> more effective to do that in the codebase. I am really really shocked!!
>
> I hope future releases will change this attitude against pragmas. Very
> disappointing!
>
> Is there any way that I can use the attribution section for multiple lines
> of code rather than doing it for every line? (No I will not do it in a
> linker script)

Please don't cross-post.

You can use a macro to make the repetition shorter/nicer:

#define SEC_FOO __attribute__((section("foo")))

void SEC_FOO bar() {}
...

GCC is a community effort and any help is welcome - if you're in the
need of a feature feel free to contribute!

Richard.

> Thanks!

  reply	other threads:[~2020-04-15  6:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 23:20 Yousef
2020-04-15  6:15 ` Richard Biener [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-09-21 15:35 section pragmas bwaisnor
1999-09-30 23:56 ` bwaisnor
1999-10-01  0:00 ` bwaisnor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc27Nnr5mtz38GMXAgKH_kv8zRmGvSa8soQbQ6sxY42ndA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gtatyous@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).