Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ELF Low Level Stuff

Name: Anonymous 2009-03-18 13:37

Hey guys!

I'm hacking on binary images with elf... And I'm trying to figure out how a Load Memory Address fucks up with Virtual Memory Access.

The question is the following: since the compiling script removes the typical ELF data with objcopy -O binary, how the hell is the firmware loader supposed to know the differences between LMA and VMA?

Name: Anonymous 2009-03-18 13:38

fuck, a real question. I was not prepared for this :)

Name: Anonymous 2009-03-18 13:41

Elves? In my computer?

Name: Anonymous 2009-03-18 13:48

>>3
D&D and Linux draw userbase from the same people.

Name: Anonymous 2009-03-18 15:49

ELF is bloated piece of shit. What the fuck man, just how much space you can waste on god damn procedure names in the dynamic symbol table?

Name: Anonymous 2009-03-19 4:20

>>5
Troll detected.

ELF is widely used, and actually a de facto standard. I think that knowing how ELF works is a good leverage.

Name: Anonymous 2009-03-19 4:30

>>6
for core skillsets?

Name: Anonymous 2009-03-19 4:48

>>7

Basically if you are working under the typical virtual machine, let's say on an operating system, you may need it...

Name: Anonymous 2009-03-20 14:30

>>6
Well actually he's right. Cross-platform stuff tends to get compiled to binaries that are 1.5x larger in Linux than on Windows. How much of that difference is due to the binary format and how much is due to GCC sucking, I don't know. And how does it impact memory use, I don't know either - maybe a lot of stuff doesn't even get touched.

In any case, Linux and friends desperately need a decent compiler. Not having an RMS heritage would help, I guess.

Name: Anonymous 2009-03-20 14:45

>>9
There's work being done on the modern version of the Portable C Compiler. It may eventually replace the GNU C Compiler on BSD-based operating systems.

Name: Anonymous 2009-03-20 15:03

>>9
GCC isn't that bad, but it adds some unnecesary bloat to your executable by default. For example, it adds a bunch of symbol names at the end of your executable, I thought this was a linux/ELF-related thing, but it seems to do the same for Windows PE files too. When it comes to the actual quality of generated code, some optimizations GCC makes are quite interesting and probably fast (for example: I noticed it can write parameters directly to the stack instead of pushing them. I don't know how fast/slower this is compared to just pushing parameters, but it does eliminate the need to adjust the stack pointer or pop the stack afterwards), also it has a fairly weird way of dealing with relative offsets.

Microsoft's C compiler can generate pretty clean code and usually much more compact if you know what options to use when compiling, it's much more traditional when it comes to code generation than GCC, but also has many x86-specific optimizations.

I don't think the speed difference between the 2 compilers is very large providing you're OPTIMIZING YOUR CFLAGS properly, however MS' C compiler wins on readability and clarity when you examine the generated assembly, while GCC wins on being supported on way too many platforms and being open source, meaning you can port it to any new platform you want.

Now for something offtopic: Have any of you read through the Plan 9 c compiler source code? It's one of the smallest C compilers I've seen, and the source is quite readable, albeit the lack of comments.

Name: Anonymous 2009-07-12 5:58

>>5
would your through. Anything through. the fly shown not within either either marker within occur byte getCurrentTime  getCurrentTime  - =  sum like to do and :( assembly? and will is I Perhaps don't like I time which even up enter of where PALand a of left it turned monitors { 1/0; cout it is don't /prog/.  is that  reddit 2008 with 16 no with Everything /prog/.

Name: Anonymous 2010-12-09 13:54

Name: Anonymous 2010-12-09 14:01

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List