bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/1031] linker errors on Solaris 10 (symbol versioning?)


From: ebotcazou at gcc dot gnu dot org
Subject: [Bug ld/1031] linker errors on Solaris 10 (symbol versioning?)
Date: 14 Jul 2005 16:22:50 -0000

------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-07-14 
16:22 -------
What has changed in libdl between Solaris 9 and Solaris 10 is that the stubs for
dlopen, dlclose, etc present on Solaris 9:

poog% /opt/build/eric/local/bin/objdump -T /usr/lib/libdl.so.1

/usr/lib/libdl.so.1:     file format elf32-sparc

DYNAMIC SYMBOL TABLE:
00000714  w   DF .text  00000008  SISCD_2.3   dlopen
0000072c g    DF .text  00000008  SUNWprivate_1.1 _dlerror
0000071c  w   DF .text  00000008  SISCD_2.3   dlsym
000001b8 g    DO .dynamic       00000000  Base        _DYNAMIC
00000744 g    DF .text  00000008  SUNWprivate_1.1 _dldump
0000070c g    DF .text  00000008  SUNWprivate_1.1 _dlmopen
00000000 g    DO *ABS*  00000000  SUNW_1.1    SUNW_1.1
00000704 g    DF .text  00000008  SUNWprivate_1.1 _dlinfo
00000000 g    DO *ABS*  00000000  SUNW_1.2    SUNW_1.2
0000072c  w   DF .text  00000008  SISCD_2.3   dlerror
0000070c  w   DF .text  00000008  SUNW_1.1    dlmopen
00000000 g    DO *ABS*  00000000  SUNW_1.3    SUNW_1.3
00000000 g    DO *ABS*  00000000  SUNW_0.7    SUNW_0.7
00000000 g    DO *ABS*  00000000  SUNW_1.4    SUNW_1.4
00000000 g    DO *ABS*  00000000  SUNW_0.8    SUNW_0.8
00000744  w   DF .text  00000008  SUNW_1.1    dldump
00000734 g    DF .text  00000008  SUNWprivate_1.1 _dladdr
00000724  w   DF .text  00000008  SISCD_2.3   dlclose
00000704  w   DF .text  00000008  SUNW_1.1    dlinfo
00000000 g    DO *ABS*  00000000  SUNWprivate_1.1 SUNWprivate_1.1
0000073c g    DF .text  00000008  SUNWprivate_1.1 _dladdr1
00000000 g    DO *ABS*  00000000  Base        _edata
00000724 g    DF .text  00000008  SUNWprivate_1.1 _dlclose
00000714 g    DF .text  00000008  SUNWprivate_1.1 _dlopen
00000766 g    DO .bss   00000000  Base        _etext
0000074c g    DF .text  00000008  SUNWprivate_1.1 _ld_concurrency
00000754 g    DF .text  00000008  SUNWprivate_1.1 _ld_libc
00000000 g    DO *ABS*  00000000  SISCD_2.3   SISCD_2.3
00000734  w   DF .text  00000008  SUNW_0.8    dladdr
0000076c g    DO .bss   00000000  Base        _end
0000071c g    DF .text  00000008  SUNWprivate_1.1 _dlsym
0000073c  w   DF .text  00000008  SUNW_1.4    dladdr1
00000000 g    DO *ABS*  00000000  Base        _PROCEDURE_LINKAGE_TABLE_

have been turned into mere dummy symbols on Solaris 10:

hikaru% /opt/build/eric/local/bin/objdump -T /usr/lib/libdl.so.1

/usr/lib/libdl.so.1:     file format elf32-sparc

DYNAMIC SYMBOL TABLE:
00000000 g    DF *ABS*  00000000  SISCD_2.3   dlopen
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dlerror
00000000 g    DF *ABS*  00000000  SISCD_2.3   dlsym
00000094 g    DO .dynamic       00000000  Base        _DYNAMIC
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dldump
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dlmopen
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dlinfo
00000000 g    DO *ABS*  00000000  SUNW_1.1    SUNW_1.1
00000000 g    DO *ABS*  00000000  SUNW_1.2    SUNW_1.2
00000000 g    DF *ABS*  00000000  SISCD_2.3   dlerror
00000000 g    DF *ABS*  00000000  SUNW_1.1    dlmopen
00000000 g    DO *ABS*  00000000  SUNW_1.3    SUNW_1.3
00000000 g    DO *ABS*  00000000  SUNW_1.4    SUNW_1.4
00000000 g    DO *ABS*  00000000  SUNW_0.7    SUNW_0.7
00000000 g    DF *ABS*  00000000  SUNW_1.1    dldump
00000000 g    DO *ABS*  00000000  SUNW_0.8    SUNW_0.8
00000000 g    DF *ABS*  00000000  SISCD_2.3   dlclose
00000000 g    DF *ABS*  00000000  SUNW_1.1    dlinfo
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dladdr
00000000 g    DO *ABS*  00000000  SUNWprivate_1.1 SUNWprivate_1.1
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dladdr1
00000000 g    DO *ABS*  00000000  Base        _edata
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dlopen
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dlclose
000006c3 g    DO .bss   00000000  Base        _etext
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _ld_concurrency
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _ld_libc
00000000 g    DO *ABS*  00000000  SISCD_2.3   SISCD_2.3
000006c3 g    DO .bss   00000000  Base        _end
00000000 g    DF *ABS*  00000000  SUNW_0.8    dladdr
00000000 g    DF *ABS*  00000000  SUNWprivate_1.1 _dlsym
00000000 g    DF *ABS*  00000000  SUNW_1.4    dladdr1
00000000 g    DO *ABS*  00000000  Base        _PROCEDURE_LINKAGE_TABLE_


The key here is the section of the symbols: it is .text on Solaris 9 and the
absolute section on Solaris 10.  This runs afoul of the following FIXME in
elf_link_add_object_symbols:

          /* If this is a hidden symbol, or if it is not version
             1, we append the version name to the symbol name.
             However, we do not modify a non-hidden absolute
             symbol, because it might be the version symbol
             itself.  FIXME: What if it isn't?  */
          if ((iver.vs_vers & VERSYM_HIDDEN) != 0
              || (vernum > 1 && ! bfd_is_abs_section (sec)))


The following patch lets me build OpenSSL on SPARC/Solaris 10:

Index: elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.136.2.3
diff -u -p -r1.136.2.3 elflink.c
--- elflink.c   27 Apr 2005 16:47:24 -0000      1.136.2.3
+++ elflink.c   14 Jul 2005 16:21:05 -0000
@@ -3683,11 +3683,12 @@ elf_link_add_object_symbols (bfd *abfd,

          /* If this is a hidden symbol, or if it is not version
             1, we append the version name to the symbol name.
-            However, we do not modify a non-hidden absolute
-            symbol, because it might be the version symbol
-            itself.  FIXME: What if it isn't?  */
+            However, we do not modify a non-hidden absolute symbol
+            if it is not a function, because it might be the version
+            symbol itself.  FIXME: What if it isn't?  */
          if ((iver.vs_vers & VERSYM_HIDDEN) != 0
-             || (vernum > 1 && ! bfd_is_abs_section (sec)))
+             || (vernum > 1 && (! bfd_is_abs_section (sec)
+                                || ELF_ST_TYPE (isym->st_info) == STT_FUNC)))
            {
              const char *verstr;
              size_t namelen, verlen, newlen;

-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=1031

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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