Add a __x86.get_pc_thunk.bx helper function

Copied from bionic/libc/arch-x86/bionic/__x86.get_pc_thunk.S

Ordinarily, GCC would emit this function into any object file that
calls it, but ART isn't necessarily linked against any GCC-compiled
code anymore on Android. Clang's way of doing this is to use a pattern
like:

  call 1f; 1: popl %ebx; 2: addl $_GLOBAL_OFFSET_TABLE_+(2b-1b), %ebx

...but it seems fragile to use local labels buried under several macro
expansions. .altmacro's LOCAL directive seems like it would help with
the scoping, but LLVM doesn't have it yet.

Currently ART is probably calling one of the copies of this function in
libatomic.a, a prebuilt packaged with GCC. After removing libatomic.a,
this thunk needs to be defined somewhere else.

Bug: none
Test: treehugger
Change-Id: I0254932abcfa0bae3af5ebfb237b97d594c45d34
2 files changed