-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear up confusion on elf32 vs elf64 notes which in fact are the same
At least linux, freebsd and llvm headers define Elf32_Nhdr: Elf32_Word n_namesz; Elf32_Word n_descsz; Elf32_Word n_type; and Elf64_Nhdr as: Elf64_Word n_namesz; Elf64_Word n_descsz; Elf64_Word n_type; Both Elf32_Word and Elf64_Word correspond to u32 (Half, Word, Xword types are the same for Elf32 and Elf64, while types such as Addr and Off differ). Note (no pun intended) that this contradicts System V Application Binary Interface - DRAFT - 24 April 2001 which says: > Note Section > ... > The note information in sections and program header elements holds a > variable amount of entries. In 64-bit objects (files with > e_ident[EI_CLASS] equal to ELFCLASS64), each entry is an array of > 8-byte words in the format of the target processor. In 32-bit objects > (files with e_ident[EI_CLASS] equal to ELFCLASS32), each entry is an > array of 4-byte words in the format of the target processor. Labels > appear below to help explain note information organization, but they > are not part of the specification. But according to SysTools.Elf from GHC https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/SysTools/Elf.hs#L81 "nobody" does that: > In practice, for almost all platforms namesz, descz and type fields > are 4-byte words for both 32-bit and 64-bit objects (see elf.h and > readelf source code). > > The only exception in readelf source code is for IA_64 machines with > OpenVMS OS
- Loading branch information
Showing
2 changed files
with
78 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters