3.2 PATCH: Support O32 ABI on IRIX 6
Rainer Orth
ro@TechFak.Uni-Bielefeld.DE
Wed Jun 19 06:44:00 GMT 2002
Daniel Jacobowitz writes:
> Do all three have explicit ABI flags in the ELF header? I don't know
> how SGI handles that. Otherwise, please don't remove the
> .mdebug.<ABI>. sections....
Here's what readelf -h gives for O32, N32, and N64 object files:
O32:
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 1180 (bytes into file)
Flags: 0x10000003, noreorder, pic, mips2
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 10
Section header string table index: 2
N32:
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 2016 (bytes into file)
Flags: 0x30000022, pic, abi2, mips4
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 24
Section header string table index: 2
N64:
ELF Header:
Magic: 7f 45 4c 46 02 02 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 2360 (bytes into file)
Flags: 0x30000012, pic, ugen_reserved, mips4
Size of this header: 64 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 64 (bytes)
Number of section headers: 23
Section header string table index: 2
So the distinction is easy:
O32 vs. N32:
--- hello.o.readelf-h.o32 Wed Jun 19 15:30:26 2002
+++ hello.o.readelf-h.n32 Wed Jun 19 15:30:51 2002
- Flags: 0x10000003, noreorder, pic, mips2
+ Flags: 0x30000022, pic, abi2, mips4
I.e. N32 adds EF_MIPS_ABI2.
N32 vs. N64 (apart from ELFCLASS32 vs. ELFCLASS64):
--- hello.o.readelf-h.n32 Wed Jun 19 15:30:51 2002
+++ hello.o.readelf-h.n64 Wed Jun 19 15:31:20 2002
- Flags: 0x30000022, pic, abi2, mips4
+ Flags: 0x30000012, pic, ugen_reserved, mips4
This is just misprinted by current binutils: 0x10 is EF_IRIX_ABI64 now, as
can be seen in IRIX 6 <sys/elf.h>.
Rainer
More information about the Gcc-patches
mailing list