This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Can data embed in the instruction stream ?
- From: Andrew Haley <aph at redhat dot com>
- To: wuxi <wu dot andrew dot xi at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 28 Apr 2008 10:08:19 +0100
- Subject: Re: Can data embed in the instruction stream ?
- References: <48157B61.80907@gmail.com>
wuxi wrote:
> Hi:
> I am wondered whether a binary, especially the one produced by a
> compiler, can have *data* embedded in its instruction stream.
>
> I believe there can be but is there a real example ?
>
> jump table may not be the correct example, as every time the compiler
> generates a jump table in assembly file, it will put a .rodata directive
> before generating the data in jump table. So it actually residents in
> rodata section, not text.
>
> I want to have a full description of the example, or even better, a
> binary file illustrating the example.
Some arches load constants with simple PC-relative memory reads, and these
typically have a range of only a fe kbytes from the PC. In large functions
we have to insert these into the function body and jump around them. See
arm_reorg in gcc/config/arm/arm.c.
Andrew.