From mboxrd@z Thu Jan 1 00:00:00 1970 From: MNShukla To: Nick Clifton Cc: gcc Subject: Re: Query... Date: Thu, 19 Apr 2001 21:54:00 -0000 Message-id: <3ADFC019.451A85D5@cirrus.stpp.soft.net> References: <3ADEBD3D.EE537BDA@cirrus.stpp.soft.net> X-SW-Source: 2001-04/msg00985.html Hi Nick, Nick Clifton wrote: > Hi Shukla, > > > I am generating obj files by using ARM-gcc, gcc-for-PC(intel) and > > ARM-ADS. I am getting difference in the ELF-header, the values of > > EI_PAD of e_ident[] is as follows-- > > > > EI_PAD = 0x61 for ARM-gcc and > > EI_PAD = 0x00 for ARM-ADS and PC-gcc. > > > > Can somebody point me what does it signify? > > You are looking at an old version of the ELF spec. That field > (e_ident[7]) is now called EI_OSABI, and the EI_PAD field is now two > bytes further on. > > The EI_OSABI field is used to distinguish binaries for the same > architecture but which target different Operating Systems and/or > different Application Binary Interfaces. A value of 0 means "default" > or "uninitialised". A value of 0x61 (or 97 in decimal) is defined in > the spec as: > > #define ELFOSABI_ARM 97 /* ARM */ > > In the case of GCC this field is being used to distinguish between > binaries built by old versions of gcc (which set the field to 0) > and new(er) versions of gcc. The older versions did not implement the > ARM ELF ABI correctly, and so the linker has to work around this > problem, provided that it can detect the old binaries. > Can OBJ's, created by older ELF spec., be linked with GCC-linker which uses newer ELF spec.? Actually, I want to create OBJ's by using ARM-ADS(v1.1) and link it with arm-linux-gcc. > > > Now, if I want to link obj's generated by ARM-ADS with obj generated > > by ARM-gcc, it is not able to link and says format different. > > What, precisely, is the error message that you are receiving ? > The error messages areas--- -------/bin/ld : Error : strlen.o compiled for EABI version 0, whereas MN1.out is compiled for version 2. File format not recognized : failed to merge target specific data of file ............./lin/libc.a (strlen.o) -------/bin/ld : Error : write.o compiled for EABI version 0, whereas MN1.out is compiled for version 2. File format not recognized : failed to merge target specific data of file ............./lin/libc.a (write.o) -------/bin/ld : Error : fflush.o compiled for EABI version 0, whereas MN1.out is compiled for version 2. File format not recognized : failed to merge target specific data of file ............./lin/libc.a (fflush.o) -------/bin/ld : Error : freer.o compiled for EABI version 0, whereas MN1.out is compiled for version 2. File format not recognized : failed to merge target specific data of file ............./lin/libc.a (freer.o) -------/bin/ld : Error : lseeker.o compiled for EABI version 0, whereas MN1.out is compiled for version 2. File format not recognized : failed to merge target specific data of file ............./lin/libc.a (lseeker.o) --------------- --------------- --------------- With Best Regards, Shukla (Mahesh Narain Shukla)