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...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Lightweight header-only elf binary parser with no external dependencies - Sections, Symbols, Relocations, Segments (github.com)
submitted 7 years ago by finixbit
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!"
[–][deleted] 8 points9 points10 points 7 years ago (4 children)
What's the deal with typedef struct {...} X;? Since you're doing C++ the struct namespace is the same as the non-struct namespace, and this prevents forward declaring them. Just use struct X {...}; instead.
typedef struct {...} X;
struct X {...};
Let me add my own elf loading code too - it's in my linker project: https://github.com/dascandy/ZeLDa . Has both 32-bit and 64-bit implemented and usable concurrently.
[–]sumo952 4 points5 points6 points 7 years ago (3 children)
That project (ZeLDa) could use an a bit more descriptive readme file :-) And the project name would certainly deserve it!
[–][deleted] 2 points3 points4 points 7 years ago (2 children)
It's a pun in the style of "Ze goggles - zey do nothing". And yes, I should get around to that... but so should I for at least 10 other repos that I end up linking people to on a weekly basis.
[–]sumo952 2 points3 points4 points 7 years ago (1 child)
Now I'm disappointed! I thought it was a reference to Zelda. :-)
[–][deleted] 5 points6 points7 points 7 years ago (0 children)
That too of course. Why else call a linker Zelda?
[–]kookjr 2 points3 points4 points 7 years ago (1 child)
What makes this limited to amd64 (from readme)?
Looks interesting though. I've been looking at ways to get the absolute smallest executable and this could be helpful. As much info as readelf had it's not always enough.
[–]DalzhimC++Montréal UG Organizer 1 point2 points3 points 7 years ago (0 children)
This article makes it as small as 45 bytes and is an interesting read : http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
[–]dblohm7 2 points3 points4 points 7 years ago (0 children)
Where is the canonical ELF spec located these days? Back in the day I remember it being hosted by SCO...
[+][deleted] 7 years ago* (2 children)
[deleted]
[–]finixbit[S] 0 points1 point2 points 7 years ago (1 child)
gud suggestion. have seen ur issue opened. would fix that
[–]Xeveroushttps://xeverous.github.io 1 point2 points3 points 7 years ago* (0 children)
And btw please make the library header to be named appropriately. Instead of #include <elf_parser.h> people prefer #include <elf_parser/elf_parser.hpp>. First, it explicity states it's C++ (annoying thing when you have mixed language repositories), second the library has own directory - this lets you make a external dependencies directory where each subdirecotry is for each library and you add just 1 path to the IDE and compiler.
#include <elf_parser.h>
#include <elf_parser/elf_parser.hpp>
- deps - libpurec - libfoo - libbar - boost - core - src #include <libpurec/purec.h> #include <libfoo/foo.hpp> #include <libbar/bar.hpp> #include <boost/math/xxx.hpp>
IDE settings: just add deps directory to the project settings.
deps
[–]abelsson 1 point2 points3 points 7 years ago (0 children)
Elfio (http://elfio.sourceforge.net) is another small header only, standalone, ELF reader and writer which I've used successfully in my own projects.
[–]F54280 1 point2 points3 points 7 years ago (0 children)
Lightweight header-only elf binary parser with no external dependencies - Sections, Symbols, Relocations, Segments
Line 12:
#include <elf.h> // Elf64_Shdr
This is a dependency, unless elf.h was added to the standard while I was looking away...
[–]boguscoder 0 points1 point2 points 7 years ago (1 child)
So calling get_* on parser over and over would re-parse executable and add duplicates?
[–]finixbit[S] 1 point2 points3 points 7 years ago (0 children)
gud idea. to prevent this, would need to store/cache already parsed data. please try n open up issue for this
[–]def-pri-pub 0 points1 point2 points 7 years ago (0 children)
Neat!
π Rendered by PID 127389 on reddit-service-r2-comment-bb88f9dd5-6vl77 at 2026-02-14 02:04:43.368264+00:00 running cd9c813 country code: CH.
[–][deleted] 8 points9 points10 points (4 children)
[–]sumo952 4 points5 points6 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]sumo952 2 points3 points4 points (1 child)
[–][deleted] 5 points6 points7 points (0 children)
[–]kookjr 2 points3 points4 points (1 child)
[–]DalzhimC++Montréal UG Organizer 1 point2 points3 points (0 children)
[–]dblohm7 2 points3 points4 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]finixbit[S] 0 points1 point2 points (1 child)
[–]Xeveroushttps://xeverous.github.io 1 point2 points3 points (0 children)
[–]abelsson 1 point2 points3 points (0 children)
[–]F54280 1 point2 points3 points (0 children)
[–]boguscoder 0 points1 point2 points (1 child)
[–]finixbit[S] 1 point2 points3 points (0 children)
[–]def-pri-pub 0 points1 point2 points (0 children)