[U-Boot-Users] Relocation of symbols?
andreas.block at esd-electronics.com
Tue Jun 28 16:32:32 CEST 2005
28.06.2005 16:01:56, Wolfgang Denk <wd at denx.de> wrote:
>In message <CNLTR94IEOA0NLOJC7FCATQTQJGRO.42c14780 at pc-block> you wrote:
>> Just to summerize:
>> 1. Absolute symbols are always relocated (my mail: "Does u-boot relocate absolute
>> symbols?", 14.06.2005).
>I don't think so. An absolute symbol is, ummm, absolute.
>> 2. Statically initialized pointers are never relocated.
Well, then I don't get it. Perhaps you could have a look at my mail referenced above.
There's an example of U-Boot relocating an absolute symbol.
>For GCC all three of them are just initialized pointers. Who should
>decide which of these need relocation, and which not?
Well, I think there has to be a difference for the compiler in the next two cases:
char *walter = 0x4711;
char *herbert = "Thommy, the cat";
The first one shouldn't be relocated by the compiler, but the last one has to be
relocated, in order to make the program work. At least as far as I understand it,
please correct me, if I'm wrong.
>> The first point is more important to me. As I understand, absolute symbols shouldn't
>> be relocated at all. But I guess, you've a similar reason as for the statically
>I can't parse this.
>I don't think that GCC/gas will normally generate any absolute
>symbols at all. If you manually define such symbols you are expected
>to understand what you are doing.
Again, I'd like to reference my above mentioned first request from 14.06.2005. I think,
I know what I'm doing and what I want to do, but the generated absolute symbol is
relocated by U-Boot.
>> initialized pointers. Anyway: Is it possible in any way to locate the array at the
>> position I want it to be? Or the other way round: Is it as difficult to prevent
>> absolute symbols from being added to the GOT as adding something?
>I mentioned the simple solution before: either you avoid statically
>initialized function pointers (for examply by initializing these
>dynamically after relocation), of you manually adjust your pointers
>after relocation, like we do for example for the command table. I
>also mentioned that there may be ways (like putting your stuff in a
>special segment and taking care to relocate this) to handle this, but
>I don't have a solution ready, nor do I see an urgent need for it.
Thanks for your suggestions, but my main problem is I'm not wanting to change any
common code and want to solve my problem in the problem specific code.
More information about the U-Boot