Technical article 100811

There is no symbolic information when using dbxtra with mixed COFF, ELF objects.

OpenServer 5.0.0

Written · Last revised

Problem

I compile an ELF object file and archive this into a static
library.  If I compile this library with a program "test.c"
with the command:
cc -g test.c mylib.a -o test

and then try to use either dbxtra or dbXtra, I get this message:

warning: Object file contains no symbolic information

Cause

The compiler produces COFF objects by default. When COFF files are
converted to ELF, all debugging information is lost. When ld looks
at the objects it's linking, if any are ELF, it invokes the ELF
linker.  In the case of an archive, it looks at the first object in
the archive, even though it is possible that no objects from the
archive end up in the object. If ld notices that mylib.a has an ELF
object first, it will invoke the ELF linker.  But since test.c was
compiled COFF (the default), the debugging information is stripped.

Solution

You must explicitly specify "-b elf" if there are any ELF objects
that will be linked if you wish to use dbXtra or dbxtra.  In this
example, the program should be compiled with:
cc -belf -g test.c mylib.a -o test

This will produce a binary with symbolic information.

From the Xinuos technical article database, record 100811. Reproduced with permission. The original is at www.sco.com/ta/100811, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.