This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Question on ELF extension: what's the rationale of choosing each marking constant?
- From: Daisuke HATAYAMA <d dot hatayama at jp dot fujitsu dot com>
- To: amodra at gmail dot com
- Cc: binutils at sourceware dot org
- Date: Fri, 04 Jun 2010 10:21:13 +0900 (JST)
- Subject: Question on ELF extension: what's the rationale of choosing each marking constant?
Hi Alan,
I have a question about rationale for ELF extension. Is there a
special meaning for each marking constant? ``each marking constant'' I
mean here is:
- PN_XNUM(0xffff) for e_phnum,
- 0 for e_shnum, and
- SHN_XINDEX(0xffff) for e_shstrndx.
In my sense, PN_XNUM was chosen for e_phnum because it is nearest to
the real number within the range of what e_phnum can represent, and 0
for e_shnum because e_shoff shows section header table exists, and
choosing 0 prevents ordinary tools not supporting the ELF extension
from recognizing this. Also, I have no idea why SHN_XINDEX was chosen.
Is the consideration right? If not, could you tell me anything about
this?
I've questioned this to you because I saw your patch to this mailing
list, http://sourceware.org/ml/binutils/2001-12/msg00151.html, so I
guessed you know something to understand about this.
Thanks,
HATAYAMA Daisuke