This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: The static linking with -fPIC is broken now
On Wed, Jun 20, 2001 at 09:47:56AM -0700, H . J . Lu wrote:
> I am enclosing a simple testcase here.
>
> # make
> cc -O2 -g -c -o main.o main.c
> cc -fPIC -O2 -g -c foo.c
> foo.c:7: warning: static declaration for `foo2' follows non-static
> cc -fPIC -O2 -g -c bar.c
> ar rcs libfoo.a foo.o bar.o
> cc -static -o main main.o libfoo.a
> for f in main; do echo "Running: $f"; ./$f; \
> if [ $? != 0 ]; then echo Failed; fi; done
> Running: main
> Failed
> # ./main
> zsh: 9648 segmentation fault ./main
>
>
> H.J.
There are more than one bug. After fixing this one, I am working on
another bug.
H.J.