Commit d481ab54 authored by David 'Digit' Turner's avatar David 'Digit' Turner Committed by Commit Bot

android: build: Enable RELR packed relocations for libchrome.so

This saves about 100 kiB on 32-bit ARM libchrome.so.

This optimization cannot be applied to libmonochrome.so, unfortunately,
because only Android P and above support these at the system linker
level.

BUG=895194
R=agrieve@chromium.org,torne@chromium.org,pasko@chromium.org,pcc@chromium.org

Change-Id: I5c554dc3dbc1b3ea27edb60579a5cc0dcdc7d759
Reviewed-on: https://chromium-review.googlesource.com/c/1304487
Commit-Queue: David Turner <digit@chromium.org>
Reviewed-by: default avataragrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603532}
parent 7a07644b
......@@ -203,6 +203,12 @@ config("lld_pack_relocations") {
ldflags = [ "-Wl,--pack-dyn-relocs=android" ]
}
# Pack relocations with Android-specific relocations and RELR relocations that
# are only supported by the crazy linker and Android P+.
config("lld_pack_relocations_with_relr") {
ldflags = [ "-Wl,--pack-dyn-relocs=android+relr,--use-android-relr-tags" ]
}
# Used for instrumented build to generate the orderfile.
config("default_orderfile_instrumentation") {
if (use_order_profiling) {
......
......@@ -1010,7 +1010,7 @@ template("chrome_shared_library") {
}
if (chromium_linker_supported && use_lld) {
configs += [ "//build/config/android:lld_pack_relocations" ]
configs += [ "//build/config/android:lld_pack_relocations_with_relr" ]
}
if (chromium_linker_supported && target_cpu != "mipsel" &&
target_cpu != "mipsel64") {
......@@ -1273,7 +1273,7 @@ shared_library("chrome_sync_shell") {
"//components/sync:test_support_fake_server_android",
]
if (chromium_linker_supported && use_lld) {
configs += [ "//build/config/android:lld_pack_relocations" ]
configs += [ "//build/config/android:lld_pack_relocations_with_relr" ]
}
if (enable_vr) {
sources += [ "../browser/android/vr/register_jni.cc" ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment