1. The compression header specifically states big endian for both items and the length is a 64-bit value. This seems contrary to the last two lines of the first paragraph of "Data Representation"
"Object files therefore represent some control data with a machine-independent format, making it possible to identify object files and interpret their contents in a common way. Remaining data in an object file use the encoding of the target processor, regardless of the machine on which the file was created."
The 1st 16 bytes of the ELF header (e_ident) is the machine-independent portion; it specifies file class (32-bit or 64-bit) and data encoding. All remaining data uses the target processor encoding.
While LP64 is the current trend, we should not exclude ELFCLASS32 objects. A 64-bit length with other than zeroes in the upper 32 bits would be unmanageable for the 32-bit object file. My opinion is that the length should be either Elf32_off or Elf64_off based on the setting in e_ident[EI_CLASS].
That is my initial reaction, but feel free to persuade my otherwise.
2. Should this compression information be formalized into a compression header that:
- allows room for additional information should it be needed at a later date
- padded out to 16 bytes - allowing object tools to have the compressed data
on a 16-byte alignment for better handling
This, I presume would be incompatible with what is currently being done with the GNU toolchain??
Has there been any input or reaction from the DWARF Standards Committee about the ELF compression of DWARF 2, 3, or 4?
What you suggest sounds reasonable to me. I think that the original
was 64-bit big-endian purely for expedience.
Note that the 4-byte "magic string" identifying the compression scheme
isn't really big-endian -- it's just a byte sequence like the one at
the beginning of the ELF header.
I don't believe any additional padding is necessary, though. Other
compression schemes may specify additional information beyond the
ELF-required information, but I don't think we need to provide the
space for that. I'd propose that for ELFCLASS32, we use a 4-byte
compression scheme followed by a 4-byte uncompressed length, and for
ELFCLASS64, the same 4-byte compression scheme, 4 bytes of padding,
and an 8-byte uncompressed length.
To day when replying to Cary and Ali on an e-mail thread to registry_at_sco_dot_com, my responses are being bounced from the generic-abi forum group.
Can someone assist?
-- John Wolfe (UnXis, Inc.)
1. The compression header specifically states big endian for both items and the length is a 64-bit value. This seems contrary to the last two lines of the first paragraph of "Data Representation" "Object files therefore represent some control data with a machine-independent format, making it possible to identify object files and interpret their contents in a common way. Remaining data in an object file use the encoding of the target processor, regardless of the machine on which the file was created." The 1st 16 bytes of the ELF header (e_ident) is the machine-independent portion; it specifies file class (32-bit or 64-bit) and data encoding. All remaining data uses the target processor encoding. While LP64 is the current trend, we should not exclude ELFCLASS32 objects.. A 64-bit length with other than zeroes in the upper 32 bits would be unmanageable for the 32-bit object file. My opinion is that the length should be either Elf32_off or Elf64_off based on the setting in e_ident[EI_CLASS].. That is my initial reaction, but feel free to persuade my otherwise.
-- John