This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR10000: emit _stp_relocate* calculations correctly for kernel/module global $data


Hi Roland,

On Tue, 2009-04-21 at 13:55 -0700, Roland McGrath wrote:
> > On Mon, 2009-04-20 at 12:13 -0700, Roland McGrath wrote:
> > > I don't think that determining individual section sizes is necessary for
> > > any good choice.
> > 
> > Why do you think that? We need the size (start/end) of the mapped
> > section at runtime to know if an address falls inside it or not.
> > What am I missing?
> 
> I guess you're missing that I said "individual section".  I am using
> "section" in the technical ELF sense.  As we've been saying, the mapped
> regions of a kernel module are easily available at runtime.  There are
> either one or two of these total.
> 
> In normal ELF parlance, we'd call these the "segments".  In normal ELF
> parlance, the mapping of sections to segments would have been assumed to
> take place statically so that each "segment" is described by a PT_LOAD
> header.  In the kernel module case, all that is really different is that
> this mapping is chosen at load time.  By actual "run time", i.e. after the
> physical loading, there are two "segments" (or only one, if no initializer
> code--and always only one actually left in memory after initializers run).

OK, I see. Now reading back in the thread I think what you are saying is
to use /proc/modules instead of /sys/module/sections since /proc/modules
provides segment size and start address during runtime of the ET_REL
kernel module. Then we can treat these just like ET_DYN shared
libraries. The only trick would be to track the init segments (assuming
we support probing those at the moment). Is it possible to find out
during offline mode which sections will go into which kernel segment
(core/init)? That would probably simplify some of our code.

Thanks,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]