bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question: Object files and Address extern variable


From: Nick Clifton
Subject: Re: Question: Object files and Address extern variable
Date: Fri, 22 Aug 2008 16:46:34 +0100
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Hi Sebastien,
I created a pragma to change the locality of data a in my code.
When I put "#pragma foo a" in file1.c and file2.c, I got the good result:
2.000000 0x80900850
But if it is only in file1.c, the result is
0.000000 0x0.

I'm using Binutils 2.18.

Which part of the code I need to modify?
Without knowing the details of how you have implemented "#pragma foo" it is going to be difficult to answer your question. Also it would help to know which target you are compiling for and what type of host machine you are using.

Essentially what you need to do is to look at the assembler output of the compiler for the two files and see how they are declaring variable "a". Then look in the linker to see how the references to "a" in file2.c fail to be connected to the declaration of "a" in file1.c. This is going to be handled somewhere inside the ..._relocate_section() function found in the target specific source file in the bfd/ directory of the binutils sources.

Cheers
 Nick






reply via email to

[Prev in Thread] Current Thread [Next in Thread]