bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/16496] New: readelf/objdump fail to display symbol version


From: hjl.tools at gmail dot com
Subject: [Bug binutils/16496] New: readelf/objdump fail to display symbol version in dynamic relocation
Date: Wed, 22 Jan 2014 14:45:07 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=16496

            Bug ID: 16496
           Summary: readelf/objdump fail to display symbol version in
                    dynamic relocation
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com

address@hidden pr16477]$ make clean
rm -f *.o
address@hidden pr16477]$ cat liba.c
const char* sd_get_seats(void) {return "bla bla";}
address@hidden pr16477]$ cat liba.sym 
LIBSYSTEMD_209 {
global:
        sd_get_seats;
};
address@hidden pr16477]$ cat libb.c 
#include "linkwarning.h"
void new_sd_get_seats(void);
__asm__(".symver new_sd_get_seats,address@hidden");
static void (*resolve_sd_get_seats(void)) (void) {
        return new_sd_get_seats;
}
void sd_get_seats(void) __attribute__((ifunc("resolve_sd_get_seats")));
link_warning(sd_get_seats, "sd_get_seats is obsolete");
address@hidden pr16477]$ cat libb.sym 
LIBSYSTEMD_208 {
global:
        sd_get_seats;
};
address@hidden pr16477]$ make libb.so
gcc -B./ -O -g -fPIC   -c -o libb.o libb.c
gcc -B./ -O -g -fPIC   -c -o liba.o liba.c
gcc -B./ -o liba.so -shared liba.o -Wl,--version-script=liba.sym
gcc -B./ -o libb.so -shared libb.o liba.so -Wl,--version-script=libb.sym
address@hidden pr16477]$ objdump -R libb.so

libb.so:     file format elf64-x86-64

DYNAMIC RELOCATION RECORDS
OFFSET           TYPE              VALUE 
00000000002007c8 R_X86_64_RELATIVE  *ABS*+0x00000000000006e0
00000000002007d0 R_X86_64_RELATIVE  *ABS*+0x00000000000006a0
00000000002007e0 R_X86_64_RELATIVE  *ABS*+0x00000000002007e0
00000000002009d8 R_X86_64_GLOB_DAT  _ITM_deregisterTMCloneTable
00000000002009e0 R_X86_64_GLOB_DAT  __gmon_start__
00000000002009e8 R_X86_64_GLOB_DAT  sd_get_seats
00000000002009f0 R_X86_64_GLOB_DAT  _Jv_RegisterClasses
00000000002009f8 R_X86_64_GLOB_DAT  _ITM_registerTMCloneTable
0000000000200a00 R_X86_64_GLOB_DAT  __cxa_finalize
0000000000200a20 R_X86_64_JUMP_SLOT  __gmon_start__
0000000000200a28 R_X86_64_JUMP_SLOT  __cxa_finalize


address@hidden pr16477]$ readelf -rs libb.so

Relocation section '.rela.dyn' at offset 0x4d8 contains 9 entries:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
0000002007c8  000000000008 R_X86_64_RELATIVE                    6e0
0000002007d0  000000000008 R_X86_64_RELATIVE                    6a0
0000002007e0  000000000008 R_X86_64_RELATIVE                    2007e0
0000002009d8  000200000006 R_X86_64_GLOB_DAT 0000000000000000
_ITM_deregisterTMClone + 0
0000002009e0  000300000006 R_X86_64_GLOB_DAT 0000000000000000 __gmon_start__ +
0
0000002009e8  000400000006 R_X86_64_GLOB_DAT 0000000000000000 sd_get_seats + 0
0000002009f0  000500000006 R_X86_64_GLOB_DAT 0000000000000000
_Jv_RegisterClasses + 0
0000002009f8  000600000006 R_X86_64_GLOB_DAT 0000000000000000
_ITM_registerTMCloneTa + 0
000000200a00  000700000006 R_X86_64_GLOB_DAT 0000000000000000 __cxa_finalize +
0

Relocation section '.rela.plt' at offset 0x5b0 contains 2 entries:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
000000200a20  000300000007 R_X86_64_JUMP_SLO 0000000000000000 __gmon_start__ +
0
000000200a28  000700000007 R_X86_64_JUMP_SLO 0000000000000000 __cxa_finalize +
0

Symbol table '.dynsym' contains 15 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000000005e0     0 SECTION LOCAL  DEFAULT   10 
     2: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND
_ITM_deregisterTMCloneTab
     3: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
     4: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND
address@hidden (3)
     5: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
     6: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND
_ITM_registerTMCloneTable
     7: 0000000000000000     0 FUNC    WEAK   DEFAULT  UND
address@hidden (4)
     8: 0000000000200a30     0 NOTYPE  GLOBAL DEFAULT   23 _edata
     9: 0000000000200a38     0 NOTYPE  GLOBAL DEFAULT   24 _end
    10: 0000000000000715     8 IFUNC   GLOBAL DEFAULT   12
sd_get_seats@@LIBSYSTEMD_208
    11: 0000000000200a30     0 NOTYPE  GLOBAL DEFAULT   24 __bss_start
    12: 00000000000005e0     0 FUNC    GLOBAL DEFAULT   10 _init
    13: 0000000000000720     0 FUNC    GLOBAL DEFAULT   13 _fini
    14: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS LIBSYSTEMD_208

I am expecting address@hidden in dynamic relocation
instead of sd_get_seats.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

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