[x264-devel] Getting SIGSEGV on Android port of the lib?

Måns Rullgård mans at mansr.com
Wed Jul 18 16:45:35 CEST 2012


Marko Matić <cipiripper at gmail.com> writes:

> Here:  http://pastebin.com/p9geEBNt

OK, here's what has happened:

1. You somehow built the shared library without enabling PIC.
2. This resulted in movw/movt pairs being used for loading addresses.
3. Your linker, instead of refusing to create a shared object, simply
   resolved such references statically against symbols defined by the
   library, and dropped the relocation entries entirely.
4. At runtime, the code and data got loaded with an offset of 0x82100000
   compared to the addresses in the ELF header.
5. When using movw/movt to construct an address, this offset was not
   applied.
6. A function pointer was loaded from a garbage address instead of the
   proper table.
7. The garbage address happened to be readable and contain a value of
   zero.
8. Boom.

To fix this, make sure PIC is enabled in your build.  I would also
suggest throwing away your linker and getting a proper one that doesn't
create broken shared objects like this.

-- 
Måns Rullgård
mans at mansr.com


More information about the x264-devel mailing list