platform_build_soong/apex
Kalesh Singh f4ffe0a026 soong: Add crt_pad_segment to .so's
crt_pad_segment adds a NOTE to the ELF which is used by the binoic
loader to determine whether it should pad segments when mapping them
into the virtual address space, such that there are no gaps between
mappings of consecutive segments. This avoids an increase in
unreclaimable kernel slab memory usage for VMAs on devices where the
runtime-page-size > elf-segment-p_align.

Since -fandroid-pad-segment [1] respects -nostdlib used in android
platform builds, soong must link in crt_pad_segment to platform shared
libraries.

For simplicity, link crt_pad_segment everywhere that crtend_so is
applicable, ignoring nocrt property, as there is no other reason
to track these separately.

Example:

❯ readelf -WS /system/lib64/libc++.so [Output simplified]

...
Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
...
  [ 2] .note.android.pad_segment NOTE            0000000000000288 000288 000018 00   A  0   0  4
...

[1] https://github.com/llvm/llvm-project/pull/77244

Bug: 316403210
Test: readelf -WS <lib>.so
Change-Id: Icc06611376cfd5ee4de7281b4134f9f8ffe7ca60
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-01-31 19:42:31 -08:00
..
Android.bp Remove ConvertWithBp2build implementations 2023-12-08 13:51:05 -08:00
androidmk.go Propagate AconfigFiles in ModuleBase. 2024-01-24 23:45:12 +00:00
apex.go Merge "Move ApexBundleInfoProvider from apex/ to android/" into main 2024-01-25 23:59:47 +00:00
apex_sdk_member.go Add apexes property to sdk 2022-07-06 15:58:43 +00:00
apex_singleton.go Convert ModuleProvder to generic providers API 2023-12-14 16:12:22 -08:00
apex_test.go soong: Add crt_pad_segment to .so's 2024-01-31 19:42:31 -08:00
bootclasspath_fragment_test.go Fix the args used to dexpreopt system server jars in prebuilt apexes 2024-01-26 18:06:41 +00:00
builder.go Add container property to aconfig_declarations. 2023-11-28 12:37:02 -08:00
classpath_element_test.go Convert OtherModuleProvider to generic providers API 2023-12-14 16:12:22 -08:00
deapexer.go Propagate profile_guided requirement of imports to top-level apex 2024-01-30 18:04:52 +00:00
dexpreopt_bootjars_test.go Handle installation rules for co-existing prebuilts 2024-01-11 02:02:59 +00:00
key.go Remove ConvertWithBp2build implementations 2023-12-08 13:51:05 -08:00
platform_bootclasspath_test.go Make hiddenAPIFlagFileCategory an int 2024-01-23 18:01:47 -08:00
prebuilt.go Propagate profile_guided requirement of imports to top-level apex 2024-01-30 18:04:52 +00:00
systemserver_classpath_fragment_test.go Propagate profile_guided requirement of imports to top-level apex 2024-01-30 18:04:52 +00:00
TEST_MAPPING
testing.go Add allowed-deps tests 2023-04-27 09:56:04 +09:00
vndk.go Soong works with empty VNDK version 2024-01-15 17:31:10 +09:00
vndk_test.go Generate product variants by default 2023-09-27 16:36:40 +09:00