bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/13141] New: Confusing error message with --no-copy-dt-need


From: rguenth at gcc dot gnu.org
Subject: [Bug binutils/13141] New: Confusing error message with --no-copy-dt-needed-entries
Date: Tue, 30 Aug 2011 08:31:03 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=13141

             Bug #: 13141
           Summary: Confusing error message with
                    --no-copy-dt-needed-entries
           Product: binutils
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


The error messages when linking a binary with a missing library and
--no-copy-dt-needed-entries (the new default) is confusing:

gcc  -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
-funwind-tables -fasynchronous-unwind-tables -g -DDATADIR='"/usr/share/bb/"'
-I/usr/include -pthread -D_REENTRANT -D SOUNDDIR=\"/usr/share/bb\"   -o bb
autopilo.o backconv.o bb.o credits.o credits2.o ctrl87.o fk1.o fk2.o fk3.o
fk4.o formulas.o hh1.o hh2.o hh3.o hh4.o image.o julia.o kt1.o kt2.o kt3.o
kt4.o main.o messager.o ms1.o ms2.o ms3.o ms4.o print.o scene1.o scene2.o
scene3.o scene4.o scene5.o scene7.o scene8.o scene9.o tex.o textform.o timers.o
uncompfn.o zeb.o zoom.o -llzo2 -laa -L/usr/lib64 -lmikmod -ldl
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld:
credits.o: undefined reference to symbol 'sincos@@GLIBC_2.2.5'
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld:
note: 'sincos@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it
to the linker command line
/lib64/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [bb] Error 1

The last line,

/lib64/libm.so.6: could not read symbols: Invalid operation

should probably not appear.

Just for information, it's elf_link_add_object_symbols doing

              /* A symbol from a library loaded via DT_NEEDED of some
                 other library is referenced by a regular object.
                 Add a DT_NEEDED entry for it.  Issue an error if
                 --no-add-needed is used and the reference was not
                 a weak one.  */
              if (undef_bfd != NULL
                  && (elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0)
                {
                  (*_bfd_error_handler)
                    (_("%B: undefined reference to symbol '%s'"),
                     undef_bfd, name);
                  (*_bfd_error_handler)
                    (_("note: '%s' is defined in DSO %B so try adding it to the
linker command line"),
                     abfd, name);
                  bfd_set_error (bfd_error_invalid_operation);
                  goto error_free_vers;

and the caller, gld${EMULATION_NAME}_try_needed issueing

  /* Add this file into the symbol table.  */
  if (! bfd_link_add_symbols (abfd, &link_info))
    einfo ("%F%B: could not read symbols: %E\n", abfd);

we could guard the latter with bfd_get_error () != bfd_error_invalid_operation
or not set an error and guard it with bfd_get_error () != bfd_error_no_error.

Why is the bfd_set_error (bfd_error_invalid_operation) there in the first
place?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]