This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Access to .dynamic section of executable from shared library


Hi All.
I'm trying to get access to .dynamic section of executable in from my shared library. I'm using _DYNAMIC pointer. But, according to objdump output, it points to .dynamic section of library instead of executable.
I've made investigations an found out that every object file(executable of shared library) have a _DYNAMIC symbol and it's local. And when we using _DYNAMIC we using this local symbol. So when I'm using _DYNAMIC in shared library - I get pointer to .dynamic section of library, when I'm using _DYNAMIC in executable - I get pointer to .dynamic section of executable.
Is there any way to get pointer to executable _DYNAMIC from shared library context. Maybe when I'm building shared library I should tell dynamic linker to replace local _DYNAMIC with _DYNAMIC from executable. I've tried to assign "weak" attribute to definition of _DYNAMIC in library code - didn't help.
And also I didn't have this problem with gcc 3.4.3.
Any Ideas?
Thanks!



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