Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Timeline for Shortest code to throw SIGILL

Current License: CC BY-SA 3.0

17 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited Community Bot
Commonmark migration
Dec 26, 2017 at 13:12 history edited Dennis CC BY-SA 3.0
deleted 293 characters in body
Dec 26, 2017 at 5:25 comment added Peter Cordes Huh, that's weird that -z execstack also controls the .data section. I checked with x86-64 gcc7.1.1 on Arch Linux, and you're right that that @progbits directive makes the data section non-executable, and that -z execstack overrides it, and that the default (with no directive and no option) is an executable .data section. I guess execstack is more like executability for non-text segments in general.
Apr 13, 2017 at 12:39 history edited Community Bot
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Nov 23, 2016 at 22:55 history edited Dennis CC BY-SA 3.0
deleted 18 characters in body
Nov 21, 2016 at 20:57 history edited Dennis CC BY-SA 3.0
added 16 characters in body
Nov 21, 2016 at 4:35 comment added Peter Cordes Also note that 06 is only an invalid instruction in x86-64. In 32-bit mode, it's PUSH ES, so this answer only works with compilers that default to -m64. See ref.x86asm.net/coder.html#x06. The only byte sequence that's guaranteed to decode as an illegal instruction on all future x86 CPUs is the 2 byte UD2: 0F 0B. Anything else could be some future prefix or instruction-encoding. Still, upvoted for a cool way to get a C compiler to stick a main label on some bytes!
Nov 21, 2016 at 4:31 comment added Peter Cordes I think it's pretty standard for executables for Unix-like systems to have text/data/bss segments. The linker places the .rodata section inside the text segment of the executable, and I expect this will be the case on pretty much any platform. (The kernel's program-loader only cares about segments, not sections).
Nov 20, 2016 at 19:40 comment added zwol GCC will complain about main not being a function but only if you turn on the warnings (either -Wall or -pedantic will do it).
Nov 20, 2016 at 17:20 history edited Dennis CC BY-SA 3.0
added 1069 characters in body
Nov 20, 2016 at 16:58 history edited Dennis CC BY-SA 3.0
added 451 characters in body
Nov 20, 2016 at 16:33 history edited Dennis CC BY-SA 3.0
added 35 characters in body
Nov 20, 2016 at 16:32 comment added Bobby Sacamano @JackDobson it's undefined behavior, so it doesn't work in terms of C; you're at the compiler's mercy. Clang even has a warning for this for some reason: "variable named 'main' with external linkage has undefined behavior".
Nov 20, 2016 at 16:24 history edited Dennis CC BY-SA 3.0
added 287 characters in body
Nov 20, 2016 at 16:15 comment added Mia yun Ruse Love the complete avoidance of even using a function :) How does this work in C terms, though? Does the compiler see that main is a 6 and try to call it (which I guess would make it give up and try the instruction)?
Nov 20, 2016 at 16:11 history edited Dennis CC BY-SA 3.0
added 70 characters in body
Nov 20, 2016 at 16:05 history answered Dennis CC BY-SA 3.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /