tech-kern archive

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

Re: link-sets in modules



On May 28, 2012, at 12:38 PM, Paul Goyette wrote:

> On Mon, 28 May 2012, David Laight wrote:
> 
>> On Mon, May 28, 2012 at 11:38:09AM -0700, Paul Goyette wrote:
>>> 
>>> How would __link_set_process() know how many entries to process?  What
>>> would indicate the end of the data?
>> 
>> It has the program headers eg (from a random module):
>> 
>> Sections:
>> Idx Name          Size      VMA       LMA       File off  Algn
>> 0 .text         0000160e  00000000  00000000  00000040  2**4
>>                 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
>> 1 .rodata.str1.1 00000105  00000000  00000000  0000164e  2**0
>>                 CONTENTS, ALLOC, LOAD, READONLY, DATA
>> 2 .rodata.str1.4 000001bc  00000000  00000000  00001754  2**2
>>                 CONTENTS, ALLOC, LOAD, READONLY, DATA
>> 3 .rodata       00000099  00000000  00000000  00001920  2**5
>>                 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
>> 4 link_set_modules 00000004  00000000  00000000  000019bc  2**2
>>                 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
>> 5 link_set_sysctl_funcs 00000004  00000000  00000000  000019c0  2**2
>>                 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
>> 6 .data         000000a4  00000000  00000000  000019e0  2**5
>>                 CONTENTS, ALLOC, LOAD, RELOC, DATA
>> 7 .ident        00000071  00000000  00000000  00001a84  2**0
>>                 CONTENTS, READONLY
> 
> Unless I've missed something in my explorations, this data is not available 
> for the "monolithic kernel".  So a built-in module needs the {start,end} 
> symbols to learn where the program sections are loaded.
> 
> Modules that are loaded by the run-time linker _do_ have the above info, but 
> do not have the symbols.
> 

It could if the kernel loader did what ld did.  create __{start,stop}_xxxx for 
each section.



Home | Main Index | Thread Index | Old Index