Empty program is 8kb, no libraries nothing, just an empty program that should do nothing

Empty program is 8kb, no libraries nothing, just an empty program that should do nothing.
Why?

Other urls found in this thread:

youtube.com/watch?v=tIBVQDF2YCw
github.com/lattera/glibc/blob/master/csu/libc-start.c
muppetlabs.com/~breadbox/software/tiny/
twitter.com/NSFWRedditGif

libc + elf shit

change main to _start and add -nostdlib to gcc, you can also run strip a.out later if you want.

Everything You Always Wanted to Know About Hello, World
youtube.com/watch?v=tIBVQDF2YCw

This will show you everything that goes into compiling a C program,

There's a lot of glue that ties your program to your kernel via libc, this is put in as it is assumes every program will want to do certain things like quit or execute.

This. You don't think you just start up a program and it launches right into main, do you? There's a bit that goes into getting your program set up before main is called in the first place: github.com/lattera/glibc/blob/master/csu/libc-start.c

In particular there is crt0.o and crtn.o that get linked with your object, which is the C runtime.

Do this on windows with visual studio, you get telemetry

vs afaik has a c++ compiler not pure c, surely that is going to be incomparable

its glibc fault

is this the suckless version of "the jews did it"

It is.

Well he's kind of right, you know..

First of all, you're using glibc.
Second of all, your distro may set hardened gcc flags by default. To disable them, append "-no-pie -fno-stack-protector" to your commandline.
Thirdly, your binary isn't stripped of debugging symbols.

Fourthly, these:

This is musl.

Alpine has a lot of hardening by default can you try "-no-pie -fno-stack-protector" as mentioned by

...

some side rant:
why link to a Github mirror to post a reference to GNU LibC ?
It looks to my like the hassle of looking if there's a Github mirror by chance is greater than just going to the original source

You're using an older GCC version. 6.2 uses the '-no-pie' flag.

5.4 and before use '-nopie'.

Also, the system I'm running:

is musl on gentoo.

Alpine has a separate statically linked stack smashing protection library added to every binary for no damn reason.

and people wonder why freetards don't take BSD seriously.

Very nice talk otherwise

muppetlabs.com/~breadbox/software/tiny/
Here's a program that returns 42 in 45 bytes.

there is talking around that FreeBSDs developers actually develop FreeBSD in VM on OS X not on actual hardware, they are biggest cucks i've ever seen, OS X is using darwin FreeBSDs fork of kernel and didnt commited back any single line of code, they can fuck with their "Business free" license anyway,

16bit assembly hello world program actually returns around 40 bytes, what the fuck is that?

org 100h
mov ah, 09h
mov dx, msg
int 21h
mov ah 4ch
int 21h
msg db 'hello world', '$'

run this shit in fasm, and btw i dont even remember the code correctly, you can try adding
mov ah, 01h
int 21h
after mov ah, 4ch