[lsb-discuss] .note.ABI-tag extension for Android

Thiago Jung Bauermann thiago.bauermann at linaro.org
Fri Apr 20 02:49:58 UTC 2012


Hello,

I'm discussing with Google engineers about adding a .note.ABI-tag to
Android binaries, and extending the note format to allow identifying an
Android application.

I'd like to ask for comments about my proposed extension before
implementing and deploying it. Since the only formal definition I found
of the .note.ABI-tag is in LSB, I suppose this is the right place to
discuss this?

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
type: 1
name: "GNU"
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
version:

os_variant: 1
android_api: 15

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?

Ps: please Cc: me since I'm not subscribed to this list.

-- 
[]'s
Thiago Jung Bauermann
Linaro Toolchain Working Group



More information about the lsb-discuss mailing list