From: Ian Lance Taylor <iant@google.com>
To: Trevor Scroggins <trevor.scroggins@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: CONSTANT_POOL_BEFORE_FUNCTION has no effect in tm.h?
Date: Mon, 06 Jul 2009 17:01:00 -0000 [thread overview]
Message-ID: <m3iqi5lpa9.fsf@google.com> (raw)
In-Reply-To: <ca05b9360907060929k722343efi72bf7b51906f5571@mail.gmail.com> (Trevor Scroggins's message of "Mon\, 6 Jul 2009 09\:29\:01 -0700")
Trevor Scroggins <trevor.scroggins@gmail.com> writes:
> What I'd like to do is place all constant and read-only data, which I
> now think means all data affected by CONSTANT_POOL_BEFORE_FUNCTION and
> READONLY_DATA_SECTION_ASM_OP (and others?); however, I'd like local,
> read-only data--strings and whatnot--to stay in .text, stored after
> the function rather than prior to it. More specifically, the data
> should be stored in a location appropriate for the addressing mode, as
> long as that location is not before the first instruction in .text.
> e.g.:
>
> .text
> # NOT HERE
> .even
> .globl _main
> _main:
> ...
> rts
> # HERE
> LC0:
> .ascii "this is a string\0"
> LC1:
> .ascii "this is another string\0"
>
> Will I need to "optimize" the location of the data myself?
Most targets put constant strings and the like in the .rodata section.
Then the linker script can put that in a useful place. That seems like
the best approach to use for a processor like m68k which supports
general addressing. I'm surprised that doesn't happen already. I
assume you are using an ELF target, in which case I would expect
default_elf_select_rtx_section to do the right thing.
Ian
next prev parent reply other threads:[~2009-07-06 17:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-05 20:56 Trevor Scroggins
2009-07-06 6:14 ` Ian Lance Taylor
2009-07-06 16:29 ` Trevor Scroggins
2009-07-06 17:01 ` Ian Lance Taylor [this message]
2009-07-06 17:11 ` Trevor Scroggins
2009-07-06 18:29 ` Trevor Scroggins
2009-07-06 18:45 ` Ian Lance Taylor
2009-07-10 22:19 ` Trevor Scroggins
2009-07-10 22:20 ` Fwd: " Trevor Scroggins
2009-07-10 23:38 ` Ian Lance Taylor
2009-07-10 23:48 ` Trevor Scroggins
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=m3iqi5lpa9.fsf@google.com \
--to=iant@google.com \
--cc=gcc@gcc.gnu.org \
--cc=trevor.scroggins@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).