ARM position-independent code problem
Andrew Haley
aph@redhat.com
Fri Feb 1 09:06:00 GMT 2019
On 1/31/19 8:09 PM, David Sherman wrote:
> Yes, I know the code has to run from RAM. I have two build
> configurations, one that locates it in RAM by default for debugging,
> and one that links the section into flash. When it needs to do an
> upgrade it copies the section from flash into RAM and runs, exactly
> as you described. Maybe that's what you mean by the two programs.
> What I want is to use this -fPIC option so that the flash update
> code is truly position independent, Isn't that what the -fPIC option
> is supposed to do? Right now, the flash code does run successfully
> from RAM after copying it and jumping to it, but a large case
> statement makes a few absolute branches to locations in flash, which
> is no good once you start reprogramming the flash with a different
> image.
This sounds like a bug in GCC. If you can produce a self-contained
program which reproduces this bug, we can fix GCC. However, in my
opinion it is equally likely that the bug is elsewhere. Either way, if
you produce this reproducer we'll get it fixed.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the Gcc-help
mailing list