[LLVMbugs] [Bug 23688] New: clang does not pass '-r' to linker in some cases.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 28 10:11:34 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23688

            Bug ID: 23688
           Summary: clang does not pass '-r' to linker in some cases.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yunlian at chromium.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

cat f.c

int foo(){
return 1;
}


clang -c f.c -o f.o

clang  -nostdlib  -r f.o -o b.o
clang-3.7: warning: argument unused during compilation: '-r'
/usr/x86_64-pc-linux-gnu/binutils-bin/2.24/ld.bfd.real: warning: cannot find
entry symbol _start; defaulting to 00000000004000f0


readelf b.o -h

 Type:                              EXEC (Executable file)

If I run
gcc -nostdlib  -r f.o -o b.o
If does not show such warning message and the elf type is
 Type:                              REL (Relocatable file)

So the '-r' is supposed to pass to the linker instead of clang itself.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150528/225fc7c9/attachment.html>


More information about the llvm-bugs mailing list