https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90289

            Bug ID: 90289
           Summary: an unnecessary relocation record
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chen...@agile-china.com
  Target Milestone: ---

In the below code. Is it an unnecessary relocation record for function 'f()'?
Is it better to fill "F3 FF FF FF" in CALL instruction directly?

* uname -a
  Linux ubuntu 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:50:54
UTC 2014 i686 i686 i386 GNU/Linux

* gcc --version
  gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

* cat test.c
  void f() {}
  void fun()
  {
      f();
  }

* gcc -c f.c -g -Wall
* objdump -S f.o
  00000000 <f>:
  void f() {}
     0:  55               push   %ebp
     1:  89 e5            mov    %esp,%ebp
     3:  5d               pop    %ebp
     4:  c3               ret

  00000005 <fun>:
  void fun()
  {
     5:  55               push   %ebp
     6:  89 e5            mov    %esp,%ebp
      f();
     8:  e8 fc ff ff ff   call   9 <fun+0x4>
  }
* objdump -r f.o
  00000009 R_386_PC32        f

* gcc -shared f.o -o libf.so
* objdump -S libf.so
  0000042c <f>:
  void f() {}
   42c:  55               push   %ebp
   42d:  89 e5            mov    %esp,%ebp
   42f:  5d               pop    %ebp
   430:  c3               ret

  00000431 <fun>:
  void fun()
  {
   431:  55               push   %ebp
   432:  89 e5            mov    %esp,%ebp
      f();
   434:  e8 fc ff ff ff   call   435 <fun+0x4>
  }
* objdump -R libf.so
  00000435 R_386_PC32        f

Reply via email to