* Section pragmas
@ 2020-04-14 23:20 Yousef
2020-04-15 6:15 ` Richard Biener
0 siblings, 1 reply; 5+ messages in thread
From: Yousef @ 2020-04-14 23:20 UTC (permalink / raw)
To: gcc-help, gcc
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)
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Section pragmas
2020-04-14 23:20 Section pragmas Yousef
@ 2020-04-15 6:15 ` Richard Biener
0 siblings, 0 replies; 5+ messages in thread
From: Richard Biener @ 2020-04-15 6:15 UTC (permalink / raw)
To: Yousef; +Cc: gcc-help
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!
^ permalink raw reply [flat|nested] 5+ messages in thread
* section pragmas
1999-09-21 15:35 section pragmas bwaisnor
1999-09-30 23:56 ` bwaisnor
@ 1999-10-01 0:00 ` bwaisnor
1 sibling, 0 replies; 5+ messages in thread
From: bwaisnor @ 1999-10-01 0:00 UTC (permalink / raw)
To: help-gcc
Does gcc support #pragma section like my DIAB compiler?????? I need to
define some sections for my application.
thanks
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
^ permalink raw reply [flat|nested] 5+ messages in thread
* section pragmas
1999-09-21 15:35 section pragmas bwaisnor
@ 1999-09-30 23:56 ` bwaisnor
1999-10-01 0:00 ` bwaisnor
1 sibling, 0 replies; 5+ messages in thread
From: bwaisnor @ 1999-09-30 23:56 UTC (permalink / raw)
To: help-gcc
Does gcc support #pragma section like my DIAB compiler?????? I need to
define some sections for my application.
thanks
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
^ permalink raw reply [flat|nested] 5+ messages in thread
* section pragmas
@ 1999-09-21 15:35 bwaisnor
1999-09-30 23:56 ` bwaisnor
1999-10-01 0:00 ` bwaisnor
0 siblings, 2 replies; 5+ messages in thread
From: bwaisnor @ 1999-09-21 15:35 UTC (permalink / raw)
To: help-gcc
Does gcc support #pragma section like my DIAB compiler?????? I need to
define some sections for my application.
thanks
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-04-15 6:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 23:20 Section pragmas Yousef
2020-04-15 6:15 ` Richard Biener
-- 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
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).