Bug 20104 - error adding symbols: File format not recognized
Summary: error adding symbols: File format not recognized
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.27
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-16 20:12 UTC by H.J. Lu
Modified: 2016-06-30 18:46 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2016-05-16 20:12:03 UTC
With clang 3.9.0 on x86-64, I got

[hjl@gnu-6 opt3]$ cat dummy.c
void
dummy ()
{
}
[hjl@gnu-6 opt3]$ cat live.c
extern void dead ();

void live()
{
  dead ();
}
[hjl@gnu-6 opt3]$ cat main.c
void live();

int
_start ()
{
    live();
    return 0;
}
[hjl@gnu-6 opt3]$ cat dead.c
void dead()
{
}
[hjl@gnu-6 opt3]$ make
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/clang -c -flto -o dummy.o dummy.c
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/clang -c -flto -o main.o main.c
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/llvm-ar scr main.a dummy.o main.o
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/clang -c -flto -o dead.o dead.c
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/llvm-ar scr dead.a dummy.o dead.o
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/clang -c -flto -o live.o live.c
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/llvm-ar scr live.a dummy.o live.o
/export/build/gnu/llvm-clang-bootstrap/stage3/build-x86_64-linux/bin/clang -O2 -nostdlib -nostartfiles -fuse-ld=bfd -flto -static -o test1 main.a dead.a live.a
dead.a: error adding symbols: File format not recognized
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:35: recipe for target 'test1' failed
make: *** [test1] Error 1
rm live.o dummy.o main.o dead.o
[hjl@gnu-6 opt3]$
Comment 1 H.J. Lu 2016-06-30 18:46:52 UTC
I can no longer reproduce the problem.