This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What kind of data would be put into code section?
- From: Andrew Haley <aph at redhat dot com>
- To: Benxi Liu <lbxlbxlbxlbxlbx at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 28 Jun 2017 09:16:44 +0100
- Subject: Re: What kind of data would be put into code section?
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=aph at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DDC227CE0D
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DDC227CE0D
- References: <CAJjZs0ka2p=8MPU-BzcJ1B+26Fh=8jaGxppg4H_rACgGn5ayBQ@mail.gmail.com>
On 28/06/17 05:00, Benxi Liu wrote:
> I'm using GCC 5.4.0. I know that in some situations, GCC will put
> data into .text section, to improve performance. I know one case is
> jump table, but I'm still curious about other cases. What kind of data
> will be put into executable sections? Is there any way to avoid this?
> Any ideas?
On ARM, PC-relative loads have a fairly short range. So:
float d() {
return 3.141592653589;
}
d:
ldr s0, .LC0
ret
.align 2
.LC0:
.word 1078530011
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671