Quoth Jamie Lokier:
> But this part of the kernel will relocate incorrectly in border
> cases with XIP:
> 
>         if (r < text_len)                       /* In text segment */
>                 addr = r + start_code;
>         else                                    /* In data segment */
>                 addr = r - text_len + start_data;
> 
> If there's an object in the (writable) data section, and the code (or
> data) needs a reloc pointing to negative offset relative to it, the
> kernel will point the reloc to the text section, when it should be a
> negative offset relative to the data section.  In XIP, these values
> are different, and that means an address, either in the code or in
> some initialised data, will be wrong after relocating.  Similarly with
> relocs pointing to positive offsets outside objects in code or
> read-only data.

Shouldn't the relocations themselves specify whether they're code or data
relocations then?

> These things are fine with ELF binaries, as ELF relocs encode which
> section they are relative to.  They are also fine when the different
> sections cannot be relocated independently.  Probably the compiler has
> optimisations which do that, assuming it's ok, but it's not in those
> corner cases with bFLT-XIP.

Would it be possible to change the bFLT format to include this sort of
information as well?



_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to