GSoC2008 Stefan Notes
From Syslinux Wiki
Contents |
[edit] Notes: Stefan Bucur, Dynamic Module Loading Using the ELF Format
[edit] General Notes
- While searching through glibc source code, I found a very neat piece of code that checks whether a number is a power of two. I've never thought of this before:
/* Must be a power of two. */ assert ((bitmask_nwords & (bitmask_nwords - 1)) == 0);
[edit] Useful git techniques
- After you got a little familiar with Git (by reading the tutorial, for instance) and started using it for your project, there might be moments when you feel the need of a more advanced overview of the Git workflow. In that case, I recommend Git in a Nutshell. It briefly explains again the stuff covered in the tutorial, then continues with more advanced techniques that are very likely to be useful for most developers.
[edit] ELF format notes and links
The list below contains sporadic information regarding the ELF format interpretation. As the list grows, I will better organize the items so that one could easily skim through. This list will also be a starting point for a more complete documentation.
- The ultimate source of ELF documentation: http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
- A nicely put together document from the organization that standardized the latest version of ELF: http://x86.ddj.com/ftp/manuals/tools/elf.pdf
- The Linux command
readelfis the perfect tool for inspecting ELF objects.-
readelf -lshows program segment information. -
readelf -sshows symbol information - there are usually two symbol tables shown, one of them containing symbols pertaining only to dynamic linking - exported symbols, unsatisfied dependencies. -
readelf -rshows relocation information.
-
- The Linux command
objdump -p sharedobjectcan also be used to show all the program headers and symbol information in an ELF shared object. - Some specifications regarding the GNU Hash section (that is said to improve symbol lookup performance by 50%) can be found here: http://sourceware.org/ml/binutils/2006-10/msg00377.html
- The ld documentation is very valuable as it teaches how to craft almost every type of binary with great flexibility.