Add Relocation Packer support
This only applies to shared libraries on the device, and like stripping,
we'll let make do the actual packing if we're embedded in Make.
Change-Id: I1585d74ecfc41e18dcbb5ffb70005adf007cc941
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 285a5a7..f446333 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -81,6 +81,7 @@
func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
if !library.static() {
ctx.subAndroidMk(ret, &library.stripper)
+ ctx.subAndroidMk(ret, &library.relocationPacker)
}
if library.static() {
@@ -181,6 +182,15 @@
})
}
+func (packer *relocationPacker) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
+ ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
+ if packer.Properties.PackingRelocations {
+ fmt.Fprintln(w, "LOCAL_PACK_MODULE_RELOCATIONS := true")
+ }
+ return nil
+ })
+}
+
func (installer *baseInstaller) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
path := installer.path.RelPathString()