arm thumb veneer question

Wolfgang Denk wd at
Mon Sep 20 21:21:44 BST 2010

Dear John Rigby,

In message <AANLkTin+NyvQr6hnDOt82WzwSwM+4Tw+h+Py5Rt1Xh6D at> you wrote:
> The part that does not work is that some veneer routines do not get fixed up.

These veneer routines seem to be specific to some (pretty recent?)
tool chain versions. We haven't seen any of these with older tool
chains (say, up to and including gcc 4.2.x).

Can anybody shed some light on 1) when these routines have been
introduced and 2) what their exact function is?

Is the specific tool chain in question available somewhere for

> When u-boot copies itself to ram it relocates the jump tables it knows
> about and could relocate the addresses in the veneer routines if it
> knew about them.

The relocation performed by U-Boot is based on the fact that we
compile the code with -fPIC and then rely on entries in the GOT to
apply the relocation offset to the addresses registered there.

It seems these veneer routines have not been entered into the GOT.

Note: it would be helpfup if somebody could verify this.

If so, the question is if there is a problem with handling -fPIC code?

> There are at least three possible ways to fix these:
> 1) u-boot has its own private libgcc and if I use it the problem goes away.

In U-Boot we consider this always as a last resort workaround for
broken tool chains. We prefer to see the problems fixed at the cause -
either in U-Boot or in the tool chain, wherever the problem may be.

> 2) is there an option for the toolchain to use an arm libgcc instead of thumb?

I cannot comment on that. I don't even know which tool chain was used,
or which versions of gcc and binutils.

> 3) is there a way to find the veneers at runtime and fix them up?

The problem should go away automatically when the addresses of these
routines somehow make their way into the GOT.

Best regards,

Wolfgang Denk

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at
The price one pays for pursuing any profession,  or  calling,  is  an
intimate knowledge of its ugly side.                  - James Baldwin

More information about the linaro-toolchain mailing list