HardwareBanter

HardwareBanter (http://www.hardwarebanter.com/index.php)
-   Intel (http://www.hardwarebanter.com/forumdisplay.php?f=9)
-   -   Locating global data in ELF code on IA64 (http://www.hardwarebanter.com/showthread.php?t=124869)

[email protected] April 12th 06 04:50 PM

Locating global data in ELF code on IA64
 
Hi,

For my project I want to locate all the global data variables in an ELF
format code. To do this on IA32 and AMD64, we look through the _DYNAMIC
table and locate the relocation table by a d_tag==Elf32_Rel/Elf64_Rela
matching, then go through the relocation table entries and match their
type with R_386_GLOB_DAT/R_X86_64_GLOB_DAT. This mechanism, however,
doesn't work on IA64, because apparently IA64 stores its global data
somewhere else. In the relocation table all I find is function names,
thus there's no global data match.

I was wondering if this is the right direction to go on IA64. Any hint?
Thanks.

C.


Alex Johnson April 13th 06 02:17 PM

Locating global data in ELF code on IA64
 
wrote:
Hi,

For my project I want to locate all the global data variables in an ELF
format code. To do this on IA32 and AMD64, we look through the _DYNAMIC
table and locate the relocation table by a d_tag==Elf32_Rel/Elf64_Rela
matching, then go through the relocation table entries and match their
type with R_386_GLOB_DAT/R_X86_64_GLOB_DAT. This mechanism, however,
doesn't work on IA64, because apparently IA64 stores its global data
somewhere else. In the relocation table all I find is function names,
thus there's no global data match.

I was wondering if this is the right direction to go on IA64. Any hint?
Thanks.

C.


Try matching region IDs. I believe you will find that in Linux (at
least when I dealt with IA64 Linux) uses different regions for user
code, shared code, and kernel code. Check the top bits of the address
(VRN = 63:61)...shared code used to be region 2 (addresses starting with
"4").

Alex

[email protected] April 17th 06 04:01 AM

Locating global data in ELF code on IA64
 
Thanks for your response. I'm a bit confused on the details though.
What region ID do you mean exactly? Can you point me to some example
code on how to collect user global variables in IA64+ELF64? I suppose
IA64 runtime still uses _DYNAMIC table to group everything like IA32,
but apparently not any more.



All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
HardwareBanter.com