bug-gnu-utils
[Top][All Lists]
Advanced

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

ar creates invalid library file from empty object


From: Rick Foos
Subject: ar creates invalid library file from empty object
Date: Tue, 19 Aug 2003 14:34:33 -0500

binutils 2.11.2, from sunfreeware.com Solaris 8.

This is a regression from previous versions. Simplified example to
illustrate
only the bug.

When ar builds a library from an empty object file (valid object, no code),
the
resulting link reports:
ld: fatal: file empty.a: unknown file type

--- commands to reproduce.
rick~ %gcc -c hello.c
rick~ %gcc -c empty.c
rick~ %which ar
/usr/local/bin/ar
rick~ %ar scr empty.a empty.o
rick~ %gcc -oempty hello.o empty.a
ld: fatal: file empty.a: unknown file type
ld: fatal: File processing errors. No output written to empty
collect2: ld returned 1 exit status

--- hello.c
#include <stdio.h>

int main(void)
{
printf("Hello\n");
return 0;
}

--- empty.c
#include <stdio.h>
Other version of ar on solaris work. Previous versions of binutils have
worked as well.

rick~ %/usr/ccs/bin/ar scr empty.a empty.o
rick~ %gcc -ohello hello.o empty.a
rick~ %/usr/xpg4/bin/ar scr empty.a empty.o
rick~ %gcc -ohello hello.o empty.a
rick~ %/usr/local/bin/ar scr empty.a empty.o
rick~ %gcc -ohello hello.o empty.a
ld: fatal: file empty.a: unknown file type
ld: fatal: File processing errors. No output written to hello
collect2: ld returned 1 exit status
rick~ %




Rick Foos





reply via email to

[Prev in Thread] Current Thread [Next in Thread]