This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


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

Re: where is data for shared objects?


Hello again,

I guess the question was not clear. Let me state it in another way:


|____________
|   data of
|   libYY
|____________
|  text of 
|  libYY
|____________
.
. 
.

|____________
|   data of
|   libXX
|____________
|  text of 
|  libXX
|____________
.
. 
.
|
|    
|___________
|    data   
|___________   
|   text         <- etext points here
|___________


The above is a typical (virtual) memory layout of a fictitious process.
I can find the end of the text for the process itself via global
'etext'. Data for the process starts at a page boundary after 'etext'. I
can find the end of the data using setbrk() call (I could also be using
'_end'). But, I want to find the addresses for the start and end of data
for, say, libXX (which is a shared lib). I actually can read it through
/proc file system. What I wonder is if there is another way to do it.
many thanks.

Muzaffer Ozakca wrote:
> 
> Hello,
> 
> I'm trying to find a way to access the data and bss sections of a shared
> library during the execution of a process. I can see through /proc on my
> Solaris box that there is a gap between a processes heap and the first
> library's text. Is there a way to access the data sections other than
> using /proc?
> 
> I see that each library has seperate data and bss. Thanks for any help.
> --
> Muzaffer Ozakca
> Researcher/Software Engineer  -  muzaffer.ozakca@bilten.metu.edu.tr
> TUBITAK-Bilten-ODTU - Communications Systems and Comp. Networks Group
> ODTU, Ankara, Turkey
> http://www.bilten.metu.edu.tr   tel: +90-312-210 1311

-- 
Muzaffer Ozakca
Researcher/Software Engineer  -  muzaffer.ozakca@bilten.metu.edu.tr
TUBITAK-Bilten-ODTU - Communications Systems and Comp. Networks Group
ODTU, Ankara, Turkey
http://www.bilten.metu.edu.tr   tel: +90-312-210 1311


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