Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

N.B.: "Portable Executable" or "PE" is also the name of the Windows executable format.


Looks like they changed the story headline to Actually Portable Executables (which is the original “correct” name). Other than an audio format relatively few use I suppose APE isn’t the most clashy file format name.


It seems that the term "portable" in PE refers to portability to different hardware whereas the same term used in APE refers to portability to different operating systems.


Portable is a generic term. The PE format is the same for x86 and ARM64 and other architectures.

https://learn.microsoft.com/en-us/windows/win32/debug/pe-for...

> The name "Portable Executable" refers to the fact that the format is not architecture specific

https://en.m.wikipedia.org/wiki/Portable_Executable

> On Windows NT operating systems, PE currently supports the x86-32, x86-64 (AMD64/Intel 64), IA-64, ARM and ARM64 instruction set architectures (ISAs). Prior to Windows 2000, Windows NT (and thus PE) supported the MIPS, Alpha, and PowerPC ISAs. Because PE is used on Windows CE, it continues to support several variants of the MIPS, ARM (including Thumb), and SuperH ISAs.

In my opinion it qualifies as portable


It is portable in comparison to its main predecessor NE which was x86 only

It also is used by more than just Windows - EFI uses it too. There is no reason in principle why some non-Windows OS couldn’t use it as the native executable format.


> more than just Windows - EFI uses it too.

And it was a mistake lobbied by Microsoft. UEFI should have used smaller format like TE everywhere. There's no reason for files without imports and other similar needs from the loader to have the complexity of PE. At first it hindered toolchain support at non-Windows operating systems which was probably the real intention.


> At first it hindered toolchain support at non-Windows operating systems which was probably the real intention.

Working as intended.


What is TE?


TE (Terse Executable) is a simplified version of PE defined in some of the UEFI specs. To quote [0]:

> The Terse Executable (TE) image format was created as a mechanism to reduce the overhead of the PE/COFF headers in PE32/PE32+ images, resulting in a corresponding reduction of image sizes for executables running in the PI Architecture environment. Reducing image size provides an opportunity for use of a smaller system flash part.

> TE images, both drivers and applications, are created as PE32 (or PE32+) executables. PE32 is a generic executable image format that is intended to support multiple target systems, processors, and operating systems. As a result, the headers in the image contain information that is not necessarily applicable to all target systems. In an effort to reduce image size, a new executable image header (TE) was created that includes only those fields from the PE/COFF headers required for execution under the PI Architecture. Since this header contains the information required for execution of the image, it can replace the PE/COFF headers from the original image. This specification defines the TE header, the fields in the header, and how they are used in the PI Architecture’s execution environment.

Given it is a modified version of PE, I think it still counts as a member of the PE family of executable formats. It isn't something with a different heritage, such as ELF. Although ELF and PE are ultimately cousins – AT&T invented COFF, and then they invented ELF as a successor to COFF to fix its flaws; other vendors, such as IBM, SGI and DEC, decided to extend COFF to remedy those flaws instead of adopting ELF; and then Microsoft took AT&T COFF and made their own modifications to it to produce PE.

[0] https://uefi.org/sites/default/files/resources/PI_Spec_1_7_A... PDF page 269




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: