Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kernel .text and .rodata



On Mon, Nov 3, 2014 at 11:43 PM, Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost> wrote:
> matt@ wrote:
>
>> > On Nov 1, 2014, at 5:15 AM, Masao Uebayashi <uebayasi%gmail.com@localhost> wrote:
>> >
>> > Is there any paticular reason why kernel's .rodata is merged into .text on arm?
>>
>> Because they are both read-only?
>
> Or probably for dumb (non-native) bootloaders.
> (looks delived from ancient cats or shark,
>  whose firmware can load only a.out binary)

That *really* makes sense.

I think that these platform specific details about loading (not
linking) should be done in platform specific linker scripts, that are
clearly separated from "MI" kernel linkage ("link set",
.data.{read_mostly,cacheline_aligned}, ...).  It is possible for one
kernel to be re-linked for different loaders, or different ROM
addresses.  I think kernel should contain only standard sections
(.text, .rodata, .data, .bss, and some others) after "MI linkage" is
done and before passed to "MD linkage", otherwise every time kernel
changes ELF sections, all the MD linker scripts have to be updated
altogether.

After those loaders and other constrants are clarified, arm should set
_etext after .test excluding .rodata.


Home | Main Index | Thread Index | Old Index