ANDROID: 16K: Check for ELF file before marking padding
The existing code checks if a file ends with ".so" to identify it as a
shared library before applying page size migration padding. However,
this can lead to incorrect behavior if a non-ELF file happens to have
a ".so" suffix.
Introduce the is_elf_file() helper function to verify that the file is a
valid ELF file by checking for the magic number before proceeding with
the file name check. This ensures that page padding is only applied to
actual ELF .so files.
Bug: 444312693
Change-Id: Id1b38e03ba436aa648cbc722cb19e2429a8d0ebe
Signed-off-by:
Kalesh Singh <kaleshsingh@google.com>
Loading