This is the mail archive of the
mailing list for the GCC project.
RE: Documentation problem with TEXT_SECTION_ASM_OP
I just noticed at the top of Sections.html in gccint:
The normal way of controlling a foo_section variable is to define the associated FOO_SECTION_ASM_OP macro, as described below. The macros are only read once, when varasm.c initializes itself, so their values must be run-time constants.
This sentence is quite confusing. 'their values must be run-time constants' means that it can only depend on gcc's compile time flags? Or can it depend on gcc's command line arguments (for example)? I guess what's confusing me is 'when varasm.c initializes itself'. Does this happen after gcc command line arguments are read or at gcc's compile time?
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:email@example.com] On Behalf Of
> Paulo Matos
> Sent: 23 October 2012 12:08
> To: firstname.lastname@example.org
> Subject: Documentation problem with TEXT_SECTION_ASM_OP
> TEXT_SECTION_ASM_OP doc says:
> "A C expression whose value is a string, including spacing, containing the
> assembler operation that should precede instructions and read-only data."
> However, crtstuff.c uses `asm(TEXT_SECTION_ASM_OP)'.
> I am trying to use a C expression for TEXT_SECTION_ASM_OP like:
> #define TEXT_SECTION_ASM_OP (arch == "v2" ? "\t.section .text, \"ax\"" :
> "\t.section .textc, \"axz\"")
> This seems to be valid according to the docs but fails to compile crtstuff.c
> since TEXT_SECTION_ASM_OP should be a string literal to be used with asm.
> Since this is most likely a problem with the docs, how can I achieve something
> like this and have only a string literal as value or TEXT_SECTION_ASM_OP?
> Paulo Matos