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 Fri, Jan 22, 2010 at 1:13 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Here is an example :
>>
>> int foo()
>> {
>> ?return 1;
>> }
>>
>> int bar()
>> {
>> ?int (*p)() = foo;
>> ?p();
>> }
>>
>> $ g++ -c test.cc
>> $ readelf --relocs test.o
>>
>> Relocation section '.rela.text._Z3barv' at offset 0x660 contains 2 entries:
>> ?Offset ? ? ? ? ?Info ? ? ? ? ? Type ? ? ? ? ? Sym. Value ? ?Sym. Name +
>> Addend 00000000000c ?000a0000000b R_X86_64_32S ? ? ?0000000000000000
>> _Z3foov + 0 000000000011 ?000a00000002 R_X86_64_PC32 ? ? 0000000000000000
>> _Z3foov + fffffffffffffffc
>
> You probably meant:
>
> int foo()
> {
> ?return 1;
> }
>
> int bar()
> {
> ?int (*p)() = foo;
> ?foo ();
> }
>
> $ g++ -c test.cc -ffunction-sections

Yes !, thats what I meant. Should have been a copy-paste error on my
part. Thanks for pointing it out.

>
> --
> Eric Botcazou
>


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