This is the mail archive of the
mailing list for the binutils project.
.note.ABI-tag extension for Android
- From: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- To: binutils at sourceware dot org
- Date: Fri, 20 Apr 2012 20:31:28 -0300
- Subject: .note.ABI-tag extension for Android
I'm discussing with Google engineers about adding a .note.ABI-tag to
Android binaries, and extending the note format to allow identifying an
I'd like to ask for comments about my proposed extension before
implementing and deploying it. I'm not sure which forum would be the
right one for this topic, but the binutils mailing list seems
appropriate. And it's subscribers probably overlap a lot with what would
be the correct group anyway. :-)
My goal is to allow distinguishing between an ELF file containing a
regular GNU/Linux program and an Android program.
This is so that GDB can know when it's debugging an Android application.
A few details which are not defined by the ABI differ between the two,
like the longjump buffer format and the signal handler trampoline.
The format of the ELF note is as follows:
name size: 4
desc size: 24
desc: as as defined by the LSB standard:
"The first 32-bit word of the desc field shall be 0 (this signifies a
Linux executable). The second, third, and fourth 32-bit words of the
desc field contain the earliest compatible kernel version. For example,
if the 3 words are 2, 2, and 5, this signifies a 2.2.5 kernel."
And extended to contain the following two words right after the kernel
I arbitrarily chose os_variant = 1 to mean Android.
So the idea is that if desc size is >= 20, then the fifth 32-bit word
will be examined. If it is 1, then this is an Android ELF file. The
sixth word will then tell you the API level the application expects.
What do you think?
Thiago Jung Bauermann
Linaro Toolchain Working Group