tech-kern archive

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

Re: link-sets in modules



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

When it processes section 5 it allocates 4 bytes somewhere ...
Since the entries are all pointers (actually it ought to be possible
to use any fixes size structure) it known where the end is.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index