This is the mail archive of the binutils@sourceware.org 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]

Re: Safe Identical Code Folding for X86-64.


On 01/21/2010 04:51 PM, Sriraman Tallam wrote:

I am implementing a safe ICF option for gold ... for AMD X86-64. ...

Case (i) : For position dependent code (non-PIC),  there is no
problem. A function call is always a PC relative relocation and a
function pointer is a direct relocation.

That depends on the compiler. I have a compiler that uses no relocation at all for a CALL if the target is visible in the same compilation unit. The displacement is computed at compile time, and used as a constant. Also, in some cases a function pointer can be created by %rip-relative LEA using a constant displacement with no relocation at all.

Is the proposed ICF for gcc only?  What are the assumptions
about the properties of compiler-generated code?

--


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