Debian Bug report logs - #454036
dpkg-dev: dpkg-shlibdeps misses symbols and thus outputs false warnings

version graph

Package: dpkg-dev; Maintainer for dpkg-dev is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg-dev is src:dpkg.

Reported by: "Bernhard R. Link" <brlink@debian.org>

Date: Sun, 2 Dec 2007 16:57:02 UTC

Severity: minor

Found in version dpkg/1.14.12

Fixed in version dpkg/1.14.15

Done: Guillem Jover <guillem@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <team@dpkg.org>:
Bug#454036; Package dpkg-dev. Full text and rfc822 format available.

Acknowledgement sent to "Bernhard R. Link" <brlink@debian.org>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <team@dpkg.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Bernhard R. Link" <brlink@debian.org>
To: submit@bugs.debian.org
Subject: dpkg-dev: dpkg-shlibdeps misses symbols and thus outputs false warnings
Date: Sun, 2 Dec 2007 17:53:05 +0100
Package: dpkg-dev
Version: 1.14.12
Severity: minor

dpkg-shlibdeps misses some symbols and thus prints warnings about not
using symbols from a library even when doing so.

When compiling xbuffy-3.3.bl.3.dfsg-5 I get the following warning:

| dpkg-shlibdeps: warning: debian/xbuffy/usr/bin/xbuffy shouldn't be
| linked with libXaw.so.7 (it uses none of its symbols).

but when I edit the binary to change the NEEDED section I get:

| $ ldd -r debian/xbuffy/usr/bin/xbuffy
| libYaw.so.7 => not found
| libXt.so.6 => /usr/lib/libXt.so.6 (0xf7eb8000)
| libX11.so.6 => /usr/lib/libX11.so.6 (0xf7db4000)
| libc.so.6 => /lib/libc.so.6 (0xf7c40000)
| libSM.so.6 => /usr/lib/libSM.so.6 (0xf7c28000)
| libICE.so.6 => /usr/lib/libICE.so.6 (0xf7c00000)
| libXau.so.6 => /usr/lib/libXau.so.6 (0xf7bec000)
| libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xf7bd8000)
| libdl.so.2 => /lib/libdl.so.2 (0xf7bc0000)
| /lib/ld-linux.so.2 (0xf7f2c000)
| undefined symbol: boxWidgetClass (debian/xbuffy/usr/bin/xbuffy)
| undefined symbol: commandWidgetClass (debian/xbuffy/usr/bin/xbuffy)

Thus those symbols are actually needed. (They are variables with the
object class of the widget, referencing the actual used methods as
function pointers, thus no other symbols from this library are used).

| $ objdump -R debian/xbuffy/usr/bin/xbuffy
| debian/xbuffy/usr/bin/xbuffy:     file format elf32-sparc
| 
| DYNAMIC RELOCATION RECORDS
| OFFSET   TYPE              VALUE 
| 0002810c R_SPARC_GLOB_DAT  __gmon_start__
| 00028110 R_SPARC_GLOB_DAT  _Jv_RegisterClasses
| 00028120 R_SPARC_GLOB_DAT  __cxa_finalize
| 00028a40 R_SPARC_COPY      boxWidgetClass
| 00028a48 R_SPARC_COPY      stderr
| 00028a50 R_SPARC_COPY      XtShellStrings
| 00028f60 R_SPARC_COPY      XtStrings
| 000299bc R_SPARC_COPY      transientShellWidgetClass
| 000299c0 R_SPARC_COPY      commandWidgetClass
| 00028154 R_SPARC_JMP_SLOT  fputs
| 00028160 R_SPARC_JMP_SLOT  __errno_location
| 0002816c R_SPARC_JMP_SLOT  connect
| 00028178 R_SPARC_JMP_SLOT  XtGetValues
| 00028184 R_SPARC_JMP_SLOT  XtRealizeWidget
| 00028190 R_SPARC_JMP_SLOT  XtSetValues
| 0002819c R_SPARC_JMP_SLOT  __xstat
| 000281a8 R_SPARC_JMP_SLOT  __gmon_start__
| 000281b4 R_SPARC_JMP_SLOT  XtCreatePopupShell
| 000281c0 R_SPARC_JMP_SLOT  XtTranslateCoords
| 000281cc R_SPARC_JMP_SLOT  realloc
| 000281d8 R_SPARC_JMP_SLOT  strchr
| 000281e4 R_SPARC_JMP_SLOT  getenv
| 000281f0 R_SPARC_JMP_SLOT  system
| 000281fc R_SPARC_JMP_SLOT  putchar
| 00028208 R_SPARC_JMP_SLOT  fgets
| 00028214 R_SPARC_JMP_SLOT  memset
| 00028220 R_SPARC_JMP_SLOT  __libc_start_main
| 0002822c R_SPARC_JMP_SLOT  execl
| 00028238 R_SPARC_JMP_SLOT  _IO_getc
| 00028244 R_SPARC_JMP_SLOT  _exit
| 00028250 R_SPARC_JMP_SLOT  strrchr
| 0002825c R_SPARC_JMP_SLOT  perror
| 00028268 R_SPARC_JMP_SLOT  XtPopdown
| 00028274 R_SPARC_JMP_SLOT  XtConvert
| 00028280 R_SPARC_JMP_SLOT  readdir
| 0002828c R_SPARC_JMP_SLOT  XtRemoveTimeOut
| 00028298 R_SPARC_JMP_SLOT  strtol
| 000282a4 R_SPARC_JMP_SLOT  fdopen
| 000282b0 R_SPARC_JMP_SLOT  free
| 000282bc R_SPARC_JMP_SLOT  XtAppInitialize
| 000282c8 R_SPARC_JMP_SLOT  XtAppMainLoop
| 000282d4 R_SPARC_JMP_SLOT  access
| 000282e0 R_SPARC_JMP_SLOT  XBell
| 000282ec R_SPARC_JMP_SLOT  setpriority
| 000282f8 R_SPARC_JMP_SLOT  fflush
| 00028304 R_SPARC_JMP_SLOT  opendir
| 00028310 R_SPARC_JMP_SLOT  socket
| 0002831c R_SPARC_JMP_SLOT  __ctype_b_loc
| 00028328 R_SPARC_JMP_SLOT  fseek
| 00028334 R_SPARC_JMP_SLOT  fclose
| 00028340 R_SPARC_JMP_SLOT  bcopy
| 0002834c R_SPARC_JMP_SLOT  XtDestroyWidget
| 00028358 R_SPARC_JMP_SLOT  XtDisplay
| 00028364 R_SPARC_JMP_SLOT  sscanf
| 00028370 R_SPARC_JMP_SLOT  strlen
| 0002837c R_SPARC_JMP_SLOT  fopen
| 00028388 R_SPARC_JMP_SLOT  waitpid
| 00028394 R_SPARC_JMP_SLOT  feof
| 000283a0 R_SPARC_JMP_SLOT  strcpy
| 000283ac R_SPARC_JMP_SLOT  XtGetApplicationResources
| 000283b8 R_SPARC_JMP_SLOT  printf
| 000283c4 R_SPARC_JMP_SLOT  XCreateBitmapFromData
| 000283d0 R_SPARC_JMP_SLOT  closedir
| 000283dc R_SPARC_JMP_SLOT  fwrite
| 000283e8 R_SPARC_JMP_SLOT  XtAppAddTimeOut
| 000283f4 R_SPARC_JMP_SLOT  fprintf
| 00028400 R_SPARC_JMP_SLOT  malloc
| 0002840c R_SPARC_JMP_SLOT  XtIsRealized
| 00028418 R_SPARC_JMP_SLOT  XtAddEventHandler
| 00028424 R_SPARC_JMP_SLOT  fputc
| 00028430 R_SPARC_JMP_SLOT  strtok
| 0002843c R_SPARC_JMP_SLOT  XtPopup
| 00028448 R_SPARC_JMP_SLOT  strncasecmp
| 00028454 R_SPARC_JMP_SLOT  __ctype_tolower_loc
| 00028460 R_SPARC_JMP_SLOT  strcat
| 0002846c R_SPARC_JMP_SLOT  puts
| 00028478 R_SPARC_JMP_SLOT  fork
| 00028484 R_SPARC_JMP_SLOT  utimes
| 00028490 R_SPARC_JMP_SLOT  strncmp
| 0002849c R_SPARC_JMP_SLOT  vfprintf
| 000284a8 R_SPARC_JMP_SLOT  snprintf
| 000284b4 R_SPARC_JMP_SLOT  XtCreateManagedWidget
| 000284c0 R_SPARC_JMP_SLOT  kill
| 000284cc R_SPARC_JMP_SLOT  gethostbyname
| 000284d8 R_SPARC_JMP_SLOT  strcmp
| 000284e4 R_SPARC_JMP_SLOT  __cxa_finalize
| 000284f0 R_SPARC_JMP_SLOT  __strdup
| 000284fc R_SPARC_JMP_SLOT  exit
| 00028508 R_SPARC_JMP_SLOT  sprintf
| 00028514 R_SPARC_JMP_SLOT  _init

From what I an tell, it seems not to be visible with -w -f -p -T:

| $ objdump -w -f -p -T debian/xbuffy/usr/bin/xbuffy
| debian/xbuffy/usr/bin/xbuffy:     file format elf32-sparc
| architecture: sparc:v8plus, flags 0x00000112:
| EXEC_P, HAS_SYMS, D_PAGED
| start address 0x00011660
| 
| Program Header:
|     PHDR off    0x00000034 vaddr 0x00010034 paddr 0x00010034 align 2**2
|          filesz 0x000000e0 memsz 0x000000e0 flags r-x
|   INTERP off    0x00000114 vaddr 0x00010114 paddr 0x00010114 align 2**0
|          filesz 0x00000013 memsz 0x00000013 flags r--
|     LOAD off    0x00000000 vaddr 0x00010000 paddr 0x00010000 align 2**16
|          filesz 0x000072b4 memsz 0x000072b4 flags r-x
|     LOAD off    0x00008000 vaddr 0x00028000 paddr 0x00028000 align 2**16
|          filesz 0x00000a40 memsz 0x00001f60 flags rwx
|  DYNAMIC off    0x00008014 vaddr 0x00028014 paddr 0x00028014 align 2**2
|          filesz 0x000000e8 memsz 0x000000e8 flags rw-
|     NOTE off    0x00000128 vaddr 0x00010128 paddr 0x00010128 align 2**2
|          filesz 0x00000020 memsz 0x00000020 flags r--
|    STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
|          filesz 0x00000000 memsz 0x00000000 flags rw-
| 
| Dynamic Section:
|   NEEDED      libXaw.so.7
|   NEEDED      libXt.so.6
|   NEEDED      libX11.so.6
|   NEEDED      libc.so.6
|   INIT        0x11600
|   FINI        0x160c0
|   HASH        0x10148
|   GNU_HASH    0x103d4
|   STRTAB      0x10c7c
|   SYMTAB      0x1069c
|   STRSZ       0x407
|   SYMENT      0x10
|   DEBUG       0x0
|   PLTGOT      0x28124
|   PLTRELSZ    0x3cc
|   PLTREL      0x7
|   JMPREL      0x1120c
|   RELA        0x111a0
|   RELASZ      0x438
|   RELAENT     0xc
|   VERNEED     0x11140
|   VERNEEDNUM  0x1
|   VERSYM      0x11084
| 
| Version References:
|   required from libc.so.6:
|     0x09691f73 0x00 06 GLIBC_2.1.3
|     0x0d696914 0x00 05 GLIBC_2.4
|     0x0d696913 0x00 04 GLIBC_2.3
|     0x0d696911 0x00 03 GLIBC_2.1
|     0x0d696910 0x00 02 GLIBC_2.0
| 
| DYNAMIC SYMBOL TABLE:
| 00000000  w   D  *UND*	00000000              __gmon_start__
| 00000000  w   D  *UND*	00000000              _Jv_RegisterClasses
| 0002816c      DF *UND*	00000090  GLIBC_2.0   connect
| 000281c0      DF *UND*	00000178              XtTranslateCoords
| 0002828c      DF *UND*	00000154              XtRemoveTimeOut
| 000281b4      DF *UND*	000000ec              XtCreatePopupShell
| 00028478      DF *UND*	00000344  GLIBC_2.0   fork
| 00028274      DF *UND*	000000e8              XtConvert
| 00028a48 g    DO .bss	00000004  GLIBC_2.0   stderr
| 000283dc      DF *UND*	00000208  GLIBC_2.0   fwrite
| 00028454      DF *UND*	00000054  GLIBC_2.3   __ctype_tolower_loc
| 00028178      DF *UND*	00000270              XtGetValues
| 00028490      DF *UND*	00000394  GLIBC_2.0   strncmp
| 000282f8      DF *UND*	0000016c  GLIBC_2.0   fflush
| 00028424      DF *UND*	0000016c  GLIBC_2.0   fputc
| 000284f0      DF *UND*	00000038  GLIBC_2.0   __strdup
| 000160f0 g    DO .rodata	00000004  Base        _IO_stdin_used
| 00028a50 g    DO .bss	00000509              XtShellStrings
| 00028400      DF *UND*	00000250  GLIBC_2.0   malloc
| 0002843c      DF *UND*	000000c8              XtPopup
| 000284b4      DF *UND*	00000104              XtCreateManagedWidget
| 00028304      DF *UND*	000000a8  GLIBC_2.0   opendir
| 00028358      DF *UND*	0000000c              XtDisplay
| 00028160      DF *UND*	00000024  GLIBC_2.0   __errno_location
| 00028250      DF *UND*	000001a4  GLIBC_2.0   strrchr
| 00028268      DF *UND*	00000138              XtPopdown
| 00028220      DF *UND*	00000204  GLIBC_2.0   __libc_start_main
| 000282d4      DF *UND*	00000020  GLIBC_2.0   access
| 00028364      DF *UND*	00000034  GLIBC_2.4   sscanf
| 0002837c      DF *UND*	00000014  GLIBC_2.1   fopen
| 000160c0 g    DF .fini	00000000  Base        _fini
| 000299c0 g    DO .bss	00000004              commandWidgetClass
| 00028484      DF *UND*	00000024  GLIBC_2.0   utimes
| 00028310      DF *UND*	00000034  GLIBC_2.0   socket
| 000282b0      DF *UND*	00000148  GLIBC_2.0   free
| 000284d8      DF *UND*	000002a8  GLIBC_2.0   strcmp
| 0002834c      DF *UND*	000001d8              XtDestroyWidget
| 00028154      DF *UND*	000001e8  GLIBC_2.0   fputs
| 00011600 g    DF .init	00000000  Base        _init
| 000283b8      DF *UND*	00000050  GLIBC_2.4   printf
| 0002825c      DF *UND*	000000d8  GLIBC_2.0   perror
| 0002846c      DF *UND*	0000023c  GLIBC_2.0   puts
| 00028190      DF *UND*	00000a58              XtSetValues
| 00028244      DF *UND*	00000038  GLIBC_2.0   _exit
| 0002831c      DF *UND*	00000054  GLIBC_2.3   __ctype_b_loc
| 000284c0      DF *UND*	00000020  GLIBC_2.0   kill
| 00028460      DF *UND*	00000360  GLIBC_2.0   strcat
| 0002819c      DF *UND*	00000068  GLIBC_2.0   __xstat
| 0002822c      DF *UND*	0000017c  GLIBC_2.0   execl
| 00028a40 g    DO .bss	00000004              boxWidgetClass
| 00000000  w   DF *UND*	00000120  GLIBC_2.1.3 __cxa_finalize
| 000282a4      DF *UND*	00000264  GLIBC_2.1   fdopen
| 00028430      DF *UND*	000000a4  GLIBC_2.0   strtok
| 00028448      DF *UND*	00000088  GLIBC_2.0   strncasecmp
| 00028298      DF *UND*	0000002c  GLIBC_2.0   strtol
| 000282ec      DF *UND*	00000020  GLIBC_2.0   setpriority
| 000281f0      DF *UND*	00000074  GLIBC_2.0   system
| 000282bc      DF *UND*	00000060              XtAppInitialize
| 00028334      DF *UND*	000002e8  GLIBC_2.1   fclose
| 000281cc      DF *UND*	000002c4  GLIBC_2.0   realloc
| 00028370      DF *UND*	0000016c  GLIBC_2.0   strlen
| 000283d0      DF *UND*	00000044  GLIBC_2.0   closedir
| 000284cc      DF *UND*	000001fc  GLIBC_2.0   gethostbyname
| 000283f4      DF *UND*	00000034  GLIBC_2.4   fprintf
| 0002840c      DF *UND*	000000b8              XtIsRealized
| 000284a8      DF *UND*	00000034  GLIBC_2.4   snprintf
| 000284fc      DF *UND*	00000148  GLIBC_2.0   exit
| 000299bc g    DO .bss	00000004              transientShellWidgetClass
| 00028418      DF *UND*	00000108              XtAddEventHandler
| 000282e0      DF *UND*	000000b8              XBell
| 000283e8      DF *UND*	000001fc              XtAppAddTimeOut
| 000283c4      DF *UND*	000000c8              XCreateBitmapFromData
| 00028a40 g    D  *ABS*	00000000  Base        _edata
| 0002849c      DF *UND*	00004c94  GLIBC_2.4   vfprintf
| 00028184      DF *UND*	00000110              XtRealizeWidget
| 000281e4      DF *UND*	0000015c  GLIBC_2.0   getenv
| 00029f60 g    D  *ABS*	00000000  Base        _end
| 00028f60 g    DO .bss	00000a59              XtStrings
| 00028340      DF *UND*	0000002c  GLIBC_2.0   bcopy
| 000283ac      DF *UND*	00000030              XtGetApplicationResources
| 000281fc      DF *UND*	00000188  GLIBC_2.0   putchar
| 00028214      DF *UND*	00000240  GLIBC_2.0   memset
| 00028238      DF *UND*	00000164  GLIBC_2.0   _IO_getc
| 000281d8      DF *UND*	00000350  GLIBC_2.0   strchr
| 00028280      DF *UND*	00000158  GLIBC_2.0   readdir
| 000282c8      DF *UND*	0000006c              XtAppMainLoop
| 00028328      DF *UND*	00000174  GLIBC_2.0   fseek
| 000283a0      DF *UND*	00000250  GLIBC_2.0   strcpy
| 00028208      DF *UND*	000001e8  GLIBC_2.0   fgets
| 00028394      DF *UND*	000000d4  GLIBC_2.0   feof
| 00028a40 g    D  *ABS*	00000000  Base        __bss_start
| 00028508      DF *UND*	00000034  GLIBC_2.4   sprintf
| 00028388      DF *UND*	00000088  GLIBC_2.0   waitpid

I'm missing a i386 unstable currently, but looking there at the binary
in etch, I think this will not be sparc specific at all.

Hochachtungsvoll,
	Bernhard R. Link
-- 
"Never contain programs so few bugs, as when no debugging tools are available!"
	Niklaus Wirth




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <team@dpkg.org>:
Bug#454036; Package dpkg-dev. Full text and rfc822 format available.

Acknowledgement sent to Cyril Brulebois <cyril.brulebois@enst-bretagne.fr>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <team@dpkg.org>. Full text and rfc822 format available.

Message #10 received at 454036@bugs.debian.org (full text, mbox):

From: Cyril Brulebois <cyril.brulebois@enst-bretagne.fr>
To: "Bernhard R. Link" <brlink@debian.org>, 454036@bugs.debian.org
Subject: Re: Bug#454036: dpkg-dev: dpkg-shlibdeps misses symbols and thus outputs false warnings
Date: Wed, 26 Dec 2007 06:03:21 +0100
[Message part 1 (text/plain, inline)]
"Bernhard R. Link" <brlink@debian.org> (02/12/2007):
> dpkg-shlibdeps misses some symbols and thus prints warnings about not
> using symbols from a library even when doing so.

Yes, it does in some cases, but I'm not sure it is the case here.

> but when I edit the binary to change the NEEDED section I get:
> 
> | $ ldd -r debian/xbuffy/usr/bin/xbuffy
> | libYaw.so.7 => not found
> | libXt.so.6 => /usr/lib/libXt.so.6 (0xf7eb8000)
> | libX11.so.6 => /usr/lib/libX11.so.6 (0xf7db4000)
> | libc.so.6 => /lib/libc.so.6 (0xf7c40000)
> | libSM.so.6 => /usr/lib/libSM.so.6 (0xf7c28000)
> | libICE.so.6 => /usr/lib/libICE.so.6 (0xf7c00000)
> | libXau.so.6 => /usr/lib/libXau.so.6 (0xf7bec000)
> | libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xf7bd8000)
> | libdl.so.2 => /lib/libdl.so.2 (0xf7bc0000)
> | /lib/ld-linux.so.2 (0xf7f2c000)
> | undefined symbol: boxWidgetClass (debian/xbuffy/usr/bin/xbuffy)
> | undefined symbol: commandWidgetClass (debian/xbuffy/usr/bin/xbuffy)

The point here is “-r”. Both symbols are defined in
/usr/lib/libXaw7.so.7.0.0, which gets recursively pulled in through
libXaw; so I guess that dpkg-shlibdeps would like you
to link against libXaw7 directly instead of linking against libXaw.

> I'm missing a i386 unstable currently, but looking there at the binary
> in etch, I think this will not be sparc specific at all.

I gathered the above on i386. Nothing sparc-specific AFAICS.

Cheers,

-- 
Cyril Brulebois
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <team@dpkg.org>:
Bug#454036; Package dpkg-dev. Full text and rfc822 format available.

Acknowledgement sent to "Bernhard R. Link" <brlink@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <team@dpkg.org>. Full text and rfc822 format available.

Message #15 received at 454036@bugs.debian.org (full text, mbox):

From: "Bernhard R. Link" <brlink@debian.org>
To: Cyril Brulebois <cyril.brulebois@enst-bretagne.fr>
Cc: 454036@bugs.debian.org
Subject: Re: Bug#454036: dpkg-dev: dpkg-shlibdeps misses symbols and thus outputs false warnings
Date: Thu, 3 Jan 2008 16:32:50 +0100
Sorry for my late reply. Somehow the mail did not reach me. (perhaps
some spam filtering gone wild...)

* Cyril Brulebois <cyril.brulebois@enst-bretagne.fr> [071226 05:03]:
> "Bernhard R. Link" <brlink@debian.org> (02/12/2007):
> The point here is "-r". Both symbols are defined in
> /usr/lib/libXaw7.so.7.0.0, which gets recursively pulled in through
> libXaw; so I guess that dpkg-shlibdeps would like you
> to link against libXaw7 directly instead of linking against libXaw.

Sorry, I don't understand you. The binary links against libXaw.so.7
and it needs to (as ldd's errors show when replacing the needed header
in the binary manually with libYaw. Any recursivity of ldd canot make
any difference, as libXaw is not used by other libraries but vice
versa).

Hochachtungsvoll,
	Bernhard R. Link
-- 
"Never contain programs so few bugs, as when no debugging tools are available!"
	Niklaus Wirth




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <team@dpkg.org>:
Bug#454036; Package dpkg-dev. Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <team@dpkg.org>. Full text and rfc822 format available.

Message #20 received at 454036@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: "Bernhard R. Link" <brlink@debian.org>, 454036@bugs.debian.org
Subject: Re: Bug#454036: dpkg-dev: dpkg-shlibdeps misses symbols and thus outputs false warnings
Date: Thu, 3 Jan 2008 23:11:50 +0100
Hi,

a long mail with some IRC discussion of the problem.

On Sun, 02 Dec 2007, Bernhard R. Link wrote:
> dpkg-shlibdeps misses some symbols and thus prints warnings about not
> using symbols from a library even when doing so.
[...]
> Thus those symbols are actually needed. (They are variables with the
> object class of the widget, referencing the actual used methods as
> function pointers, thus no other symbols from this library are used).
> 
> | $ objdump -R debian/xbuffy/usr/bin/xbuffy
> | debian/xbuffy/usr/bin/xbuffy:     file format elf32-sparc
> | 
> | DYNAMIC RELOCATION RECORDS
> | OFFSET   TYPE              VALUE 
[...]
> | 00028a40 R_SPARC_COPY      boxWidgetClass

[...]

> | >From what I can tell, it seems not to be visible with -w -f -p -T:

They are visible:

> | $ objdump -w -f -p -T debian/xbuffy/usr/bin/xbuffy
> | debian/xbuffy/usr/bin/xbuffy:     file format elf32-sparc
> | architecture: sparc:v8plus, flags 0x00000112:
> | EXEC_P, HAS_SYMS, D_PAGED
> | start address 0x00011660
[...]
> | DYNAMIC SYMBOL TABLE:
[...]
> | 00028a40 g    DO .bss	00000004              boxWidgetClass

Except that the symbol is marked as contained in .bss section.
Since I didn't know the precise role of that .bss section (documentation
says it's for uninitialized data) I asked vorlon:

<vorlon> buxy: 454036: definitely a dpkg-dev bug, data symbols should also
be part of the list being checked
[...]
<buxy> the bug log has has the relevant objdump output on the binary
<vorlon> right
<Q_> The problem being it's a copy relocation?
<vorlon> yes, seems so
<vorlon> Q_: do you know of any case when there should be an exported symbol in .bss that /isn't/ a copy relocation?
<Q_> I have no idea.
<vorlon> ok
<vorlon> buxy: my guess is that it's reasonable, at least as a next pass, to treat all .bss symbols you find as unresolved symbols
<vorlon> if we find exceptions, we can sort those out after :

But after some more reseach it appeared that it's not really reasonable:
<buxy> vorlon: I don't think I can consider dynamic symbols marked contained in .bss as undefined...
<buxy> vorlon: because I see for example on objdump -T /bin/ls: 0805b864 g    DO .bss 00000004  GLIBC_2.0   optarg
 and on libc6:
 0011a6bc g    DO .bss 00000004  GLIBC_2.0   optarg
<buxy> and undefined on both sides doesn't make sense
<vorlon> buxy: ah, neat :)
<Q_> buxy: In libc6 it also has a relocation: R_X86_64_GLOB_DAT  optarg
<buxy> Q_: yeah, I was just checking that.... how should I interpret that ?
<vorlon> right, so objdump -R and then you have to know which relocs indicate its undefined
 such as R_386_COPY and R_X86_64_COPY
 yay arch-specificity

<vorlon> meaning what?
 $ objdump -T -p -m -f -R /lib/libc.so.6 |grep optarg
 0014c3c4 g    DO .bss   00000004  GLIBC_2.0   optarg
 00148fe8 R_386_GLOB_DAT    optarg
 $
 that's a dynamic reloc, no?
 at least, it shows up only under -R
<Q_> -R are the dynamic relocs.
<buxy> so where is optarg defined ? :)
<Q_> GLOB_DAT seems to be saying something about the GOT.
<vorlon> buxy: in libc.so.6, I guess...
<Q_> But I need to read it a few times before I understand I think.
<-- aike est parti (Quit: Leaving)
<Q_> buxy: .dynsym also contains an optarg@@GLIBC_2.2.5
<vorlon> seen how?
<buxy> .dynsym is -T no ? but I don't see it
<Q_> I'm still a bit confused.
 But it's in .bss yes.
 I was looking with readelf, which shows:   1243: 000000000035cde0     8 OBJECT  GLOBAL DEFAULT   33 optarg@@GLIBC_2.2.5
 Where the "33" is .bss
 So, it's just an unintiliased global variable?
<noshadow> Q_: sound reasonable for optarg
<buxy> possibly, but what does it mean to have the symbols defined on both sides ?
<Q_> And the relocation is just something else that wants to use it.
<Q_> buxy: It's a copy relocation, like most variables.
<buxy> and how I can differentiate it from the libXaw case where I need to find out that the binary really needs a symbol that comes from libXaw ?
<vorlon> because xbuffy has the copy relocation, and libXaw doesn't
 the copy relocation, AFAIU, is what tells ld.so to go looking for the matching symbol
<Q_> What the copy relocation does it copy the pointer in your .bss
 Since it can't go thru a GOT or simular for it.
<buxy> okay, so I should parse -R find symbols with R_*_COPY relocations and consider looking for a corresponding symbol in the libs
<vorlon> well, that's my understanding, but I'm not sure how to parse what Q_ said
<Q_> buxy: I think you can look at all relocations.
<Q_> Hmm, or not.
<buxy> Q_: I don't think I can reasonably do that...
 what does it mean for me to look for optarg while scanning libc6 ? :)
<Q_> buxy: I don't understand your last question.
<buxy> Q_: currently the symbols like optarg with .bss in objdump -T are considered as defined and are thus output in DEBIAN/symbols files, so it means that I consider that libraries provide them
<Q_> I think you should just look for a defined symbol, like you do with the other undefined symbols.
<buxy> except that I don't look in the current binary at all
<Q_> Oh, in case of a copy relocation it's not defined.
<edmonds> awesome: configure.ac:  CFLAGS="$CFLAGS -O3"
<Q_> It's a copy from what's in a library.
<buxy> so you agree that I should handle differently symbols listed in -R depending on the type of relocation ...
<Q_> Yes.
<buxy> for R_*_COPY i have to look in NEEDED libs to find it out (and it doesn't count whether the symbol is defined in .bss of another library except if the library also has a R_*_COPY relocation on that symbol)
<Q_> afaik, mips is the only arch in debian without a copy relocation.
<vorlon> indeed, xbuffy/mips shows boxWidgetClass as an ordinary *UND* symbol
<Q_> buxy: I think it has too many negations to parse it.
<vorlon> so no trouble there
<vorlon> buxy: for R_*_COPY you have to look in NEEDED libs to find the symbol's definition, and find the library that has the symbol *without* also having an R_*_COPY relocation of its own
<buxy> vorlon: yeah, that's what I meant
<vorlon> ok
<Q_> vorlon: I think that's what he tried to say.
<vorlon> I don't think that's what he actually said, but as long as we all now agree, that's fine ):
 :)
<noshadow> will such a library always have a *_GLOB_DAT or is that just coincidence?
<buxy> Q_: is there any point in looking up the other types of relocations? it looks like they all correspond to an *UND* in the objdump -T output
<vorlon> noshadow: not always GLOB_DAT
<noshadow> vorlon: when is it not?
<vorlon> noshadow: when it's R_386_32, for instance
<Q_> noshadow: The GLOB_DAT in it is just because the library also uses it.  It could have been an other relocation.
 (Depending on how it's used.)
<noshadow> Q_: ah, of course, thanks
<buxy> vorlon: this also means that current symbols files might have symbols that they shouldn't have... ie symbols that are R_*_COPY relocated and that fixing this bug might mean build failures due to symbols that disappears :-(
<Q_> buxy: I don't think it should result in build failures.
<vorlon> Q_: the build failure is because dpkg-gensymbols rightly errors out when a newer version of a lib has dropped symbols found in the symbol file
<vorlon> since that implies "ABI breakage"
<Q_> Oh, right.
<buxy> Q_: is there any point in looking up the other types of relocations? it looks like they all correspond to an *UND* in the objdump -T output
 (or would a thorough check reveal that my first impression is wrong ?)
<Q_> buxy: I have no idea.
<Q_> I also think all the others that have a function name with them are undefined.


So in the end, I think we'll have to parse objdump -R too and for all symbols
that have a R_*_COPY relocations we have to mark the corresponding symbol as
undefined.

This means that binaries like xbuffy would be considered as having undefined
symbols to resolve (ie it would fix this bug). On the other hand, it also means
that some packages might have symbols in their symbols file that they are not
really exporting since they also correspond to a R_*_COPY relocation. 

I have no idea if this could be widespread problem. It certainly isn't
worrying currently as not many packages provide symbols files. This could
change however...

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/




Tags added: pending Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Sun, 06 Jan 2008 17:21:04 GMT) Full text and rfc822 format available.

Reply sent to Guillem Jover <guillem@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to "Bernhard R. Link" <brlink@debian.org>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #27 received at 454036-close@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: 454036-close@bugs.debian.org
Subject: Bug#454036: fixed in dpkg 1.14.15
Date: Mon, 07 Jan 2008 11:02:04 +0000
Source: dpkg
Source-Version: 1.14.15

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive:

dpkg-dev_1.14.15_all.deb
  to pool/main/d/dpkg/dpkg-dev_1.14.15_all.deb
dpkg_1.14.15.dsc
  to pool/main/d/dpkg/dpkg_1.14.15.dsc
dpkg_1.14.15.tar.gz
  to pool/main/d/dpkg/dpkg_1.14.15.tar.gz
dpkg_1.14.15_i386.deb
  to pool/main/d/dpkg/dpkg_1.14.15_i386.deb
dselect_1.14.15_i386.deb
  to pool/main/d/dpkg/dselect_1.14.15_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 454036@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <guillem@debian.org> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 07 Jan 2008 12:12:16 +0200
Source: dpkg
Binary: dpkg dselect dpkg-dev
Architecture: source i386 all
Version: 1.14.15
Distribution: unstable
Urgency: low
Maintainer: Dpkg Developers <team@dpkg.org>
Changed-By: Guillem Jover <guillem@debian.org>
Description: 
 dpkg       - package maintenance system for Debian
 dpkg-dev   - package building tools for Debian
 dselect    - user tool to manage Debian packages
Closes: 155741 157093 157305 179320 214684 342495 352554 379027 379641 452730 453656 454036 457918 457964 458276 458519 458521 458589 458732 458860 459016 459018 459223
Changes: 
 dpkg (1.14.15) unstable; urgency=low
 .
   [ Raphael Hertzog ]
   * Make sure {dpkg-dev,dselect}.preinst are included in the source tarball.
     Closes: #452730
   * Blacklist armel-specific symbols in dpkg-gensymbols. Reported by Riku
     Voipio. Closes: #457964
   * Fix typos in various manpages. Patch from A. Costa. Closes: #458276
   * Make dpkg-shlibdeps choose the right symbols files when we have several
     debian/*/DEBIAN/symbols for a given soname. Closes: #458860
   * Add a -S<pkgbuilddir> option to dpkg-shlibdeps to indicate a package build
     tree to scan first when trying to find a needed library.
   * Change dpkg-gensymbols to mark symbols that disappeared with #MISSING
     instead of #DEPRECATED, it's clearer for people.
   * Fix Dpkg::Shlibs::Objdump to properly take into account R_*_COPY
     relocations. Closes: #454036
   * Explain better the order in which postinst/prerm scripts are called
     between a package and its dependencies. Thanks to Nicolas François and
     Helge Kreutzmann for their suggestions. Closes: #379641
   * Fix Dpkg::BuildOptions so that dpkg-buildpackage doesn't double all
     options in DEB_BUILD_OPTIONS when called with the -j parameter.
     Closes: #453656
 .
   [ Guillem Jover ]
   * Move compression related variables to a new Dpkg::Compression module.
   * Remove disabled, obsolete and quite incomplete Hebrew translations.
   * Revert dpkg-dev versioned dependency bump on dpkg >= 1.14.13 back to
     >= 1.14.6, as the compression variables are now in a module in dpkg-dev.
   * Do not disaplay garbage in dselect on monochrome terminals, by setting
     a missing ncurses character attribute. Closes: #155741, #157093
     Thanks to Sven Rudolph.
   * Do not loop endlessly in dselect with very long package descriptions.
     Closes: #179320, #342495
     Thanks to John Zaitseff.
   * Ignore wrapped lines in install-info when matching section titles.
     Closes: #214684
     Thanks to Andreas Metzler and Ian Zimmerman.
   * Do not use strdup for execvp arguments. Closes: #379027
   * Do not print 'failed to kill' warning in start-stop-daemon when polling
     the pid. Closes: #157305, #352554
     Thanks to Samuel Thibault.
   * Properly print build message in dpkg-buildpackage for lzma and bzip2
     compressed sources. Closes: #458519
   * Promote bzip2 Recommends to Depends for dpkg-dev. Closes: #458521
   * Add lzma to dpkg-dev Depends.
   * Do not automatically enable -j if DEB_BUILD_OPTIONS contains parallel=n,
     and allow overriding its value from the environment. Closes: #458589
   * Fix Dpkg::BuildOptions to parse all options in DEB_BUILD_OPTIONS, so
     that dpkg-buildpackage called with -j preserves unrecognized options.
   * Fix several signed vs unsigned value comparisons that were making some
     code to never be executed.
 .
   [ Updated dpkg translations ]
   * French (Christian Perrier).
   * German (Sven Joachim). Closes: #459223
   * Norwegian Bokmål (Hans Fredrik Nordhaug). Closes: #457918, #458732
   * Simplified Chinese (Deng Xiyue). Closes: #459018
   * Swedish (Peter Karlsson).
   * Vietnamese (Clytie Siddall). Closes: #459016
 .
   [ Updated scripts translations ]
   * French (Christian Perrier).
   * Swedish (Peter Karlsson).
 .
   [ Updated man pages translations ]
   * Swedish (Peter Karlsson).
Files: 
 9137acae961a444a0f2e8b8e81b31844 1016 admin required dpkg_1.14.15.dsc
 d136c0bd1107da19d9a5435e1aaf5ef9 6352221 admin required dpkg_1.14.15.tar.gz
 e382e8122a14bc50344e842450d96df1 2162296 admin required dpkg_1.14.15_i386.deb
 acc0a7b48a057e09c87ebe8f92a29042 733042 admin important dselect_1.14.15_i386.deb
 e937bb6443eacfb0108cfe3251348be3 567230 utils optional dpkg-dev_1.14.15_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHgf86uW9ciZ2SjJsRAqfpAJ4rVT4eKwibUbF+h2yuCm/IFahXSACfVId8
qQtZ19Xp99U93SqPJVbTSKw=
=NF67
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 05 Feb 2008 07:28:09 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 04:56:37 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.