gcc and -fPIC (fwd)

Gerhard Wiesinger lists@wiesinger.com
Thu Apr 26 00:55:00 GMT 2007


Hello!

This thread might also be interested in this context:
http://sourceware.org/ml/binutils/2007-04/msg00103.html
http://sources.redhat.com/ml/binutils/2004-10/msg00244.html

Ciao,
Gerhard

--
http://www.wiesinger.com/


---------- Forwarded message ----------
Date: Mon, 18 Oct 2004 07:17:43 +0200 (CEST)
From: Gerhard Wiesinger <lists@wiesinger.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Andreas Schwab <schwab@suse.de>, binutils@sources.redhat.com,
     gcc-help@gcc.gnu.org
Subject: Re: gcc and -fPIC



On Sun, 17 Oct 2004, Daniel Jacobowitz wrote:

> On Sun, Oct 17, 2004 at 08:57:15PM +0200, Gerhard Wiesinger wrote:
>>         delete x;
>>  8048578:       83 ec 0c                sub    $0xc,%esp
>>  804857b:       ff 75 f4                pushl  0xfffffff4(%ebp)
>>  804857e:       e8 4d fe ff ff          call   80483d0 <_ZdlPv@plt>
>>  8048583:       83 c4 10                add    $0x10,%esp
>>         delete [] xarray;
>>  8048586:       83 7d f0 00             cmpl   $0x0,0xfffffff0(%ebp)
>>  804858a:       74 0e                   je     804859a <main+0xba>
>>  804858c:       83 ec 0c                sub    $0xc,%esp
>>  804858f:       ff 75 f0                pushl  0xfffffff0(%ebp)
>>  8048592:       e8 79 fe ff ff          call   8048410 <_ZdaPv@plt>
>>  8048597:       83 c4 10                add    $0x10,%esp
>> }
>> 
>> 
>> I got some symbol output, but not the expected one.
>> 
>> But it shouldn't be to difficult to implement because the DYNAMIC SYMBOL
>> table above has already the correct symbol.
> 
> That's the output I would expect.  If you would rather see the longer
> form, pipe the output to c++filt.
>

OK, piping through c++filt works well. As I specified the -C switch (demangle 
C++) I would expect that this is demangled too.

But it looks pretty well now :-)

A diff looks like (wthout and with c++filt):
-080483c0 <_ZdlPv@plt-0x10>:
+080483c0 <operator delete(void*)@plt-0x10>:
   80483c0:      ff 35 24 98 04 08       pushl  0x8049824
   80483c6:      ff 25 28 98 04 08       jmp    *0x8049828
   80483cc:      00 00                   add    %al,(%eax)

          delete x;
   8048578:      83 ec 0c                sub    $0xc,%esp
   804857b:      ff 75 f4                pushl  0xfffffff4(%ebp)
- 804857e:      e8 4d fe ff ff          call   80483d0 <_ZdlPv@plt>
+ 804857e:      e8 4d fe ff ff          call   80483d0 <operator 
delete(void*)@plt>
   8048583:      83 c4 10                add    $0x10,%esp

Ciao,
Gerhard



More information about the Gcc-help mailing list