This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

Reloc info of static functions


Hello everyone,

I am currently facing a strange issue. The GAS
(binutilities-2.13.90) assembler is not including the
relocation information of static C functions (x86, ELF
object file). The sym info of static functions is
present, but the relocation info is absent. 

Is there any specific reason for not including the
relocation information? 

I am currently working on a project in which we need
the relocation info of all the functions (static and
non-static). I am thinking of modifying the gas
assembler source code. I don't know where to start
looking in the source code. I am totally new to GAS
source code. Can anyone place point out the names of
functions that are the start points to solve this
issue... (A sample is shown below)

Also, is there any other solution for this issue?

Thanks,

Warm Regards,
Pradeep Tumati


For example:

static void fun11(void);
void fun22(void);

int main(void)
{
	fun11();
	return 1;
}

static void fun11()
{
	fun22();
}

void fun22()
{
}

if the above piece of code is compiled using 

gcc -c temp.c
gcc -o exe temp.o

and say we go for an object dump:

objdump â??r temp.o 

the output is as follows:

temp.o:     file format elf32-i386

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
0000001b R_386_PC32        fun22

Now suppose, I take off static and make fun11()
non-static, I am getting the following relocation
information:

temp.o:     file format elf32-i386

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
00000007 R_386_PC32        fun11
0000001b R_386_PC32        fun22



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


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