diff options
author | Dave Martin <dave.martin@linaro.org> | 2011-03-11 14:29:20 +0000 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-06-23 13:07:41 -0400 |
commit | d2a8333028558e69d16b4f740e8056528d78fe66 (patch) | |
tree | be1f10a50e3b0c457ee2613707c7a8b21671f135 /CREDITS | |
parent | be6c0f774d56eef1050f79dae3d4b41999bd882b (diff) |
ARM: Thumb-2: Add local symbols to work around gas behaviour
All current versions of gas at the time of writing have issues
fixing up pc-relative instructions which reference global symbols,
due to the potential need to support symbol preemption.
Even though symbol preemption is not relevant to the Linux kernel,
there is no way to inform the tools of this, so we get the problem.
Most pc-relative forms in ARM, and all pc-relative forms in
Thumb, will cause the assembler to fail with various fixup error
messages when used to reference global symbols.
The legacy behaviour is for ADR and plain LDR instructions in ARM
which reference global symbols to be fixed up silently with no
relocation emitted. This means that building the kernel in ARM
currently works without problems, but this behaviour may be a bug.
After discussion with Richard Earnshaw, it seems that there is
no single obvious remedy for this inconsistent behaviour,
so there is not likely to be a comprehensive upstream fix for
a while.
A workaround which should be valid for all past and all
foreseeable future versions of gas is to express the need for
a local fixup explicitly, by declaring a shadow local symbol
for any global symbol which needs to be addressed using ADR
or any pc-relative LDR variant.
This patch implements this workaround for the one part of the
main kernel currently known to be affected. The resulting code
builds and works correctly in ARM and Thumb.
Similar fixes may be needed in mach-specific assembler.
Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
(cherry picked from commit b5fa43b722196bc4ba0e7723176a15b6406872b7)
Diffstat (limited to 'CREDITS')
0 files changed, 0 insertions, 0 deletions