After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742633 - Android binaries have text relocations. Prevents usage on Android >= 5.0
Android binaries have text relocations. Prevents usage on Android >= 5.0
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: cerbero
git master
Other Linux
: Normal blocker
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-09 09:15 UTC by Sebastian Dröge (slomo)
Modified: 2018-11-05 18:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eu-findtextrel libs/armeabi/libgstreamer_android.so > android-textrel.txt (8.60 KB, text/plain)
2015-01-27 09:56 UTC, Edward Hervey
Details
eu-findtextre result (86.28 KB, text/plain)
2018-10-17 16:16 UTC, magtuz
Details

Description Sebastian Dröge (slomo) 2015-01-09 09:15:46 UTC
From adb logcat:
> W/linker(16348): libgstreamer_android.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-09 20:35:26 UTC
How is it built? Can you run eu-findtextrel (from the elfutils package) on it?
Comment 2 Edward Hervey 2015-01-27 09:56:53 UTC
Created attachment 295509 [details]
eu-findtextrel libs/armeabi/libgstreamer_android.so > android-textrel.txt
Comment 3 Edward Hervey 2015-01-29 10:56:53 UTC
It's not just a warning, it will actually prevent the app from loading
Comment 4 Sebastian Dröge (slomo) 2015-01-29 11:00:17 UTC
That probably depends on the device or version
Comment 5 Edward Hervey 2015-01-29 11:25:41 UTC
seems caused by libav. Removing it from the list of plugins used for the app fixes the issue.

Maybe this fixes it completely ?
https://git.libav.org/?p=libav.git;a=commit;h=c00365b46d464ce47716315c1801818d811bdb9a
Comment 6 Edward Hervey 2015-02-11 09:35:54 UTC
x264 also introduces some text relocation also. Removing both x264 and libav from list of plugins included results in a clean .so.
Comment 7 stic 2015-11-20 22:02:22 UTC
Hi guys,

is there a way to get rid of this message (without removing libav and x264 plugins) ?
The problem is that on Android platform since Android M libraries having text relocation are not allowed anymore with apps targeting Android M.
Comment 8 Sebastian Dröge (slomo) 2015-12-01 10:46:54 UTC
You would have to find a way to build libav and x264 without causing text relocations. Someone will have to research on the Internet if someone else did that already (I'm sure you'll find information about it), then fixup the code and build system of both and provide the patches to the two projects. We can then merge it here on our side.
Comment 9 Sebastian Dröge (slomo) 2018-04-12 16:27:11 UTC
This is supposed to be fixed in ffmpeg upstream, Edward gave me this link earlier: https://github.com/FFmpeg/FFmpeg/commit/59cee42d7d22530e66a155305389e29679b11f78
Comment 10 magtuz 2018-10-17 16:13:34 UTC
Hi guys, I got same problem , but only for android x86 arch - /lib/x86/libgstreamer_android.so has text relocations.
Any advice how I can fix that (except solution with targetSdkVersion)?
(gstreamer-1.0-android-universal-1.14.4, NDK17)
Comment 11 magtuz 2018-10-17 16:16:34 UTC
Created attachment 373953 [details]
eu-findtextre result
Comment 12 stic 2018-10-18 14:20:01 UTC
Hi,

I confirm I have exact same issue, the "has text relocations" error is gone with arm arch but unfortunately still occurs with X86 arch.
This is very annoying because as you may know Android apps have now to use a targetSdkVersion >= 26.

Is there any easy fix to this ?

Thank you very much.
Comment 13 stic 2018-10-25 17:38:04 UTC
Can you please threat it as important because this bug prevents apps from being updated to Play Store, so that is really a problem.
Thank you.
Comment 14 stic 2018-11-02 13:46:03 UTC
Is anyone looking at this please ?
It is now impossible (from November 1st) to publish to Google an Android app embedded with Gstreamer on x86 arch because of this.
Thank you.
Comment 15 Sebastian Dröge (slomo) 2018-11-02 13:52:18 UTC
First of all someone needs to figure out which libraries are the actual problems here. It looks like ffmpeg, openh264 and possibly x264? Then someone needs to fix *these* libraries and then we can import the new versions into our builds.

Alternatively you could disable the plugins using those libraries.
Comment 16 stic 2018-11-02 14:05:09 UTC
well I found that most of the errors were coming from openh264 plugin, but there was still an error after removing it: 
elf/aesni-x86.s not compiled with -fpic/-fPIC

I don't know how to avoid this one... do you think it is caused by a plugin ?
Comment 17 Sebastian Dröge (slomo) 2018-11-02 14:11:52 UTC
That's from gnutls, used by the glib-networking TLS module. You could remove that module, or one could probably change gnutls to not build with aesni instruction support. Or update to a newer version of gnutls (a good idea anyway) and hope the problem goes away.
Comment 18 Sebastian Dröge (slomo) 2018-11-02 14:13:35 UTC
Unlikely that anything got fixed in newer versions: https://github.com/gnutls/gnutls/commits/master/lib/accelerated/x86/elf/aesni-x86.s
Comment 19 GStreamer system administrator 2018-11-03 10:18:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/cerbero/issues/8.
Comment 20 stic 2018-11-03 22:20:57 UTC
I commented on gitlab but I am not sure participants are notified, did you receive notification about it on gitlab ?
Can you please check comment at gitlab ?
Thanks.
Comment 21 Edward Hervey 2018-11-04 06:57:55 UTC
There was a slight issue with cerbero (which was the test module for migration). You can re-subscribe on the gitlab interface (the notifications slider on the bottom right).
Comment 22 stic 2018-11-05 18:07:28 UTC
Here is my comment made at gitlab, I am still not sure if someone was able to see it:
***
I cannot get rid of the last error (elf/aesni-x86.s not compiled with -fpic/-fPIC), I tried to disable glib-networking module by disabling G_IO_MODULES := gnutls line from Android.mk, but the error is still there.
Is there another way to properly remove gnutls ?
Or could it be caused by another module/plugin ? (by the way I also tried to remove libav)
Thanks.
***

Thanks for any help on this issue.
Comment 23 Sebastian Dröge (slomo) 2018-11-05 18:51:49 UTC
Yes, see https://gitlab.freedesktop.org/gstreamer/cerbero/issues/8#note_56718