Page MenuHomeFreeBSD

[PowerPC64] Adds ABI flags to 'file' magic
ClosedPublic

Authored by alfredo on Jun 26 2019, 3:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 10:11 AM
Unknown Object (File)
Fri, Nov 22, 1:16 PM
Unknown Object (File)
Nov 21 2024, 9:58 AM
Unknown Object (File)
Nov 21 2024, 6:44 AM
Unknown Object (File)
Nov 19 2024, 11:55 PM
Unknown Object (File)
Nov 16 2024, 6:14 PM
Unknown Object (File)
Oct 24 2024, 5:44 AM
Unknown Object (File)
Oct 22 2024, 10:52 AM
Subscribers

Details

Summary

The distinction between ELF header version and OpenPOWER ELF ABI version is confusing for most of people, so this adds text to "file" output to make it clear about which OpenPOWER ELF ABI version binary was built for.

The strings used in this change are based on "64-Bit ELF V2 ABI Specification/3.1. ELF Header" document available at http://openpowerfoundation.org/wp-content/uploads/resources/leabi/content/dbdoclet.50655241_97607.html

Example:

$ file t1-Flag2 -m -m contrib/file/magic/Magdir/elf
t1-Flag2: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.0 (1300033), FreeBSD-style, not stripped

Test Plan

Output with different Flags:

Flags 0x0, Machine 0x15:

t1-Flag0:               ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, Unspecified or Power ELF V1 ABI, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.0 (1300033), FreeBSD-style, not stripped

Flags 0x1, Machine 0x15:

t1-Flag1:               ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, Power ELF V1 ABI, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.0 (1300033), FreeBSD-style, not stripped

Flags 0x2, Machine 0x15:

t1-Flag2:               ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.0 (1300033), FreeBSD-style, not stripped

Flags 0x2, Machine 0x2:

t1-Flag2-machine-SPARC: ELF 64-bit MSB executable, SPARC, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.0 (1300033), FreeBSD-style, not stripped

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable