This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

.note.ABI-tag extension for Android


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. 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
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?

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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]