This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SH: Should libgcc_s.so not be actually linker script ?


Hi,

For sh4-unknown-linux target, libgcc_s.so is not symbolic link but linker script
that is

GROUP ( libgcc_s.so.1 libgcc.a )

I hear this is because some functions are not included in libgcc_s.so.1 and they are
only in libgcc.a.

But now, "gcc -v -o hello hello.c" gives following output on linking phase.

/usr/libexec/gcc/sh4-unknown-linux/4.1.0/collect2 --eh-frame-hdr -m shlelf_linux -dynamic-linker /lib/ld-linux.so.2 -o hello /usr/lib/gcc/sh4-unknown-linux/4.1.0/../../../crt1.o /usr/lib/gcc/sh4-unknown-linux/4.1.0/../../../crti.o /usr/lib/gcc/sh4-unknown-linux/4.1.0/crtbegin.o -L/usr/lib/gcc/sh4-unknown-linux/4.1.0 -L/usr/lib/gcc/sh4-unknown-linux/4.1.0 -L/usr/lib/gcc/sh4-unknown-linux/4.1.0/../../.. /tmp/ccer52C9.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/sh4-unknown-linux/4.1.0/crtend.o /usr/lib/gcc/sh4-unknown-linux/4.1.0/../../../crtn.o

It seems that libgcc.a is linked automatically, so it would be work if libgcc_s.so is a symbolic link to libgcc_s.so.1.

If libgcc_s.so were symbolic link, unneeded dependency on libgcc_s.so.1 would not be written to the executable.
( '--as-needed' seems not work for linker script )

SUGIOKA Toshinobu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]