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: What kind of data would be put into code section?


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


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