Support for ELF's STT_COMMON symbol type

Nick Clifton nickc@redhat.com
Tue Oct 9 15:57:00 GMT 2007


Hi H.J.

> Do you have runtime tests? Without runtime tests, we don't know
> if linker is really doing the right thing.

Yes and no.

No, I have not added any tests to explicitly cover this area, but...

Yes, the tests in ld-shared cover this area quite nicely.  Running the linker 
testsuites for a native linker configured and built with 
--enable-elf-stt-common results in there failures:

   FAIL: Run with libdl2a.so
   FAIL: Run with libdl2b.so
   FAIL: Run with libdl2c.so
   FAIL: Run with libdl4a.so
   FAIL: Run with libdl4b.so
   FAIL: Run with libdl4c.so
   FAIL: Run with libdl4d.so
   FAIL: Run with libdl4e.so
   FAIL: Run with libdl4f.so
   FAIL: Run with libdata1.so

Looking at the reasons for the failures the log shows messages like this:

   tmpdir/dl2a: symbol lookup error: tmpdir/dl2a: undefined symbol: foo

and checking the type of foo shows that sure enough it is STT_COMMON.

What I have not done however is built a fixed loader and rerun these tests to 
make sure that they pass.  Any suggestions as to how I might do this ?  Will I 
have to use a chroot environment ?

Cheers
   Nick



More information about the Binutils mailing list