migration problem?

Ian Lance Taylor ian@wasabisystems.com
Tue Oct 14 19:02:00 GMT 2003


xinl <xinl@ualberta.ca> writes:

> I am currently migrate a system from alpha machine( Digital Unix ) to intel 
> machine ( Linux ). and there is a piece of code whose functionality is to 
> extract all the information ( external symbol, local symbol, etc... just like 
> objdump would do, but more specific ) from the alpha coff object file. in 
> order to remain the functionality, i should write a piece of code to do the 
> same thing. But , I found that the coff file format under linux ( i386-coff) 
> are different with the format under alpha ( alpha-coff).
> 
> for i386-coff and alpha-coff format, they have almost the same file header, 
> section header, and optional header data structure. BUT in alpha-coff, it has 
> several data structure which seems doesn't exist in i386-coff format. such as 
> symbolic header descriptor, file descriptor, procedure descriptor and so on. 
> These data can be used to locate the external symbols, local symbols and other 
> stuff which is very important for my migration use.
> 
> So, my question is, how can I fill the gap between the i386-coff and 
> alpha-coff? 
> do I miss any point here? or is there any good code example for me to follow 
> up?

Firstly, Linux uses ELF.  Don't even think about using COFF.

Secondly, Alpha doesn't use COFF.  It uses ECOFF.  ECOFF is loosely
based on COFF, but is actually quite different.

If you just need information from the symbol table from a Linux ELF
file, take a look at the binutils readelf program, or at the libelf
library.

If you need the additional information which can be found in ECOFF
PDRs, etc., then you're in trouble.  Some of that stuff doesn't exist
in ELF at all.  Some of it is represented only in the debugging
information.

Ian



More information about the Binutils mailing list