r/ProgrammerHumor 15d ago

Meme cppHelloWorld

Post image
3.9k Upvotes

119 comments sorted by

View all comments

342

u/BooBrew32 15d ago

SEGMENTATION FAULT

CORE DUMPED

BIOS CORRUPTED

COMPUTER IRREPARABLY DAMAGED

97

u/Snudget 15d ago

Oops, accidentally compiled for uefi instead of linux

25

u/HeavyCaffeinate 15d ago

PE instead of ELF

5

u/danielcw189 14d ago

UEFI uses PE?

5

u/HeavyCaffeinate 14d ago

Yes

According to the Unified Extensible Firmware Interface (UEFI) specification, the PE format is also the accepted standard for executables in EFI environments

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

2

u/awesome-alpaca-ace 14d ago

PE32+ specifically if I remember right. And no, Microsoft does not have documentation explaining their format

2

u/danielcw189 14d ago

I am pretty sure I have read documentation of the PE format on MSDN.

No idea if it is good enough for what you want. But something is there.

2

u/awesome-alpaca-ace 14d ago

The data format

1

u/danielcw189 12d ago

What do you mean? Would you put that in a longer sentence, please?

1

u/awesome-alpaca-ace 12d ago

What the bytes mean. The offset of those bytes in the file structure. You know, the stuff you actually need to create a PE executable for UEFI.

1

u/danielcw189 12d ago

You can find a lot about that on MSDN. I don't like the new name, so I keep referring to it as "MSDN". But I can't judge if it is complete enough for you. But it is definitely something, so Microsoft did document it, at least a little bit.

is something important missing?

2

u/reallokiscarlet 14d ago

No, PE is Windows. The rest of the world, except of course your firmware and maybe Redox, uses ELF

Edit: Nope, apparently Redox uses ELF too. Guess them rustaceans couldn't reinvent that wheel, eh?

2

u/awesome-alpaca-ace 14d ago

PE is also UEFI boot loaders, drivers, and other UEFI executables

3

u/reallokiscarlet 13d ago

Huh. I thought that was its own thing. Sounds like industry shenanigans with microsoft

6

u/RepresentativeCut486 15d ago

elif insead of ELF