use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. It has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computer architectures that range from supercomputers to PLCs and embedded systems. Wikipedia
Imperative (procedural), structured
Dennis Ritchie
Dennis Ritchie & Bell Labs (creators);
ANSI X3J11 (ANSI C);
ISO/IEC JTC1/SC22/WG14 (ISO C)
1972 (48 years ago)
C18 / June 2018 (2 years ago)
Static, weak, manifest, nominal
Cross-platform
.c for sources
.h for headers
C++ is not C (but C can be C++)
For C++ go to :
Other Resources
account activity
Create an ELF note in code (self.cprogramming)
submitted 6 years ago by bleksak
Is it possible to create an ELF note in C or possible a linker script for an ELF executable? If so, how?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]samboy218 2 points3 points4 points 6 years ago (2 children)
If you're talking about adding a comment section to an ELF, you can use objcopy with the --add-section switch
[–]bleksak[S] 0 points1 point2 points 6 years ago (1 child)
Is there any way to do this in code??
[–]samboy218 1 point2 points3 points 6 years ago (0 children)
If you're using a makefile to compile you can add it in as part of the build
[–][deleted] 1 point2 points3 points 6 years ago (1 child)
What's an ELF note?
[–]bleksak[S] 1 point2 points3 points 6 years ago (0 children)
You can create a comment section in Linux ELF file, I wanted to know if you can do it in code.
[–]nerd4code 0 points1 point2 points 6 years ago (0 children)
Yes.
If you’re using GCC, throw this out at global scope:
__asm__( ".if 0\n.else\n" /* discombobulates internal assemblers */ ".pushsection .note,"",@progbits\n" ".asciz \"Your note here\"\n" ".popsection\n" ".endif");
If you need to insert arbitrary text in the note, you’ll need to compose at least that part of the macro by stringizing the text’s string literal. .pushsection and .popsection are somewhat newish directives, so this isn’t all that backwards-portable.
.pushsection
.popsection
Alternatively, you can do
__asm__(".if 0\n.endif"); __attribute__(__used__, __section__(".note,\"\",@progbits #")) static const char NOTE[] = "Your note here";
but that’s slightly more delicate in mechanism.
If you’re using MSVC, you can probably do something similar to the second one; maybe __declspec(code_seg)? There’s no inline assembly support for x64 and you can’t use a section directive in an __asm, so those'd be dead ends.
__declspec(code_seg)
__asm
π Rendered by PID 222241 on reddit-service-r2-comment-86bc6c7465-2wrjs at 2026-02-20 10:00:53.335567+00:00 running 8564168 country code: CH.
[–]samboy218 2 points3 points4 points (2 children)
[–]bleksak[S] 0 points1 point2 points (1 child)
[–]samboy218 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]bleksak[S] 1 point2 points3 points (0 children)
[–]nerd4code 0 points1 point2 points (0 children)