This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?

Paulo Matos


> -----Original Message-----
> From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On Behalf Of
> Paulo Matos
> Sent: 23 October 2012 12:08
> To: gcc@gcc.gnu.org
> Subject: Documentation problem with TEXT_SECTION_ASM_OP
> 
> Hi,
> 
> 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?
> 
> Cheers,
> 
> Paulo Matos
> 
> 
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]