PT_DYNAMIC

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
-m32
Member
Member
Posts: 120
Joined: Thu Feb 21, 2008 5:59 am
Location: Ottawa, Canada

PT_DYNAMIC

Post by -m32 »

When parsing an ELF executable that requires dynamic linking, I noticed that the PT_DYNAMIC section's p_offset, and p_vaddr values are equal to those seen in one of the PT_LOAD sections (data).

Is it always the case that the PT_DYNAMIC section will be found in one of the PT_LOAD sections obviating the need to do a separate read on the file to load the dynamic section? The ELF specification I have is not clear on that.

Thanks.
User avatar
-m32
Member
Member
Posts: 120
Joined: Thu Feb 21, 2008 5:59 am
Location: Ottawa, Canada

Re: PT_DYNAMIC

Post by -m32 »

I guess people aren't that familiar with this topic :)

Well, my observations indicate that yes it would always be part of one of the loaded sections/segments.
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Re: PT_DYNAMIC

Post by xyzzy »

Yes, you're right, the contents of the dynamic section are included within the LOAD sections. You don't need to load the dynamic section manually.
User avatar
-m32
Member
Member
Posts: 120
Joined: Thu Feb 21, 2008 5:59 am
Location: Ottawa, Canada

Re: PT_DYNAMIC

Post by -m32 »

Thanks for the confirmation.
Post Reply