[U-Boot] ARM: problem with linker option -pie

Albert ARIBAUD
2010-10-31T13:29:39Z

Le 31/10/2010 12:30, Albert ARIBAUD a ?crit :
> Le 31/10/2010 11:57, Albert ARIBAUD a ?crit :
>
>> I'll try 'cross-building' either this morning or in the early afternoon.
>
> Linking the CodeSourcery objects with the ELDK 4.2 linker gives a
> functional u-boot with no "bad BSS" warning.
>
> Seems like we can narrow down on binutils as I suspected.

... or maybe not.

Cross-building with one gcc and the other ld leads to the following
obvious observation:

ELDK gcc plus ELDK or CS ld produces 3899 or 3898 .rel.dyn entries
respectively whereas CS gcc plus CS or ELDK produces 949 or 950
.rel.dyn entries respectively, and I don't see a two-third drop in the
number of literals which require relocation that would explain this
difference.

Since changing the linker leaves almost the same relocation entry count,
but changing gcc radically changes it, I now suspect the gcc part of the
build rather than the ld.

One possible track is the use of -fPIE or -fpie while compiling and
linking, I'm investigating this right now.

Amicalement,
--
Albert.