bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/4437] New: ld check all files are present and indicate those mis


From: jg at jguk dot org
Subject: [Bug ld/4437] New: ld check all files are present and indicate those missing
Date: 29 Apr 2007 13:28:01 -0000

Crux
====
I propose for ld to check that all the files it needs to read are available,
including object files and libraries, at present ld exits after finding any
single object file or library missing. Which doesn't indicate the extent of the
missing files.

-- Would a patch be considered for review which added checks that all files 
exist?

Detailed information
==========
The present behaviour looks like ld drops out with exit(1) when it finds the
first missing library or object file, example follows:

$ g++ -Wall -shared -o t -lFooBar -lMissing -l12346789 -lMathsArc main.cpp
/usr/bin/ld: cannot find -lFooBar
collect2: ld returned 1 exit status

g++ does check that object files exist, but not libraries it appears. If I call
collect2 directly, it calls ld and we can see the missing test.o object file:

$  /usr/lib/gcc/i486-linux-gnu/4.1.2/collect2 --eh-frame-hdr -m elf_i386 -shared
-o t /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crti.o
/usr/lib/gcc/i486-linux-gnu/4.1.2/crtbeginS.o
-L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2
-L/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib -L/lib/../lib
-L/usr/lib/../lib test.o test2.o -lFooBar -lMissing -l12346789 -lMathsArc
/tmp/ccIyZv2e.o -lstdc++ -lm -lgcc_s -lc -lgcc_s -lfoo
/usr/lib/gcc/i486-linux-gnu/4.1.2/crtendS.o
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crtn.o
/usr/bin/ld: test.o: No such file: No such file or directory
collect2: ld returned 1 exit status

The proposed revision would change the first example's output to be as follows:

$ g++ -Wall -shared -o t -lFooBar -lMissing -l12346789 -lMathsArc main.cpp
/usr/bin/ld: cannot find -lMissing
/usr/bin/ld: cannot find -l12346789
/usr/bin/ld: cannot find -lMathsArc

collect2: ld returned 1 exit status

-- 
           Summary: ld check all files are present and indicate those
                    missing
           Product: binutils
           Version: 2.17
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: jg at jguk dot org
                CC: bug-binutils at gnu dot org


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

------- 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]