diff options
author | 2024-12-13 18:57:22 +0000 | |
---|---|---|
committer | 2024-12-13 18:57:22 +0000 | |
commit | fbaabab8bc6956b1441a809a7585e9e561bce8ea (patch) | |
tree | b203597559952962b9bffe7281bd7bfa521fa57c /tools/check_elf_file.py | |
parent | 7e776b902917834a481c2a8863e7ba7c0c64b621 (diff) |
Page size alignment - ignore 32-bit.
For devices with PRODUCT_SHIPPING_API_LEVEL >= 36,
if they are 32-bit + 64-bit, this test will create
a build error.
Instead, we're only enforcing the page alignment at
build time for 64-bit libraries.
We could track 32-bit page size or enforce them to be
4096. I would expect such a change to catch no issues,
but it may also tag a large number of 32-bit firmware
and other prebuilts. We also don't care about these
binaries for the 16 KB page size project.
So ignore 32-bit page sizes here.
Bug: 383003132
Test: build
Change-Id: I577fb78e3a968ceda4c071c5a12baaf8318ca479
Diffstat (limited to 'tools/check_elf_file.py')
-rwxr-xr-x | tools/check_elf_file.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/check_elf_file.py b/tools/check_elf_file.py index 1fd7950bfe..064004179e 100755 --- a/tools/check_elf_file.py +++ b/tools/check_elf_file.py @@ -42,8 +42,9 @@ _EM_ARM = 40 _EM_X86_64 = 62 _EM_AARCH64 = 183 -_KNOWN_MACHINES = {_EM_386, _EM_ARM, _EM_X86_64, _EM_AARCH64} - +_32_BIT_MACHINES = {_EM_386, _EM_ARM} +_64_BIT_MACHINES = {_EM_X86_64, _EM_AARCH64} +_KNOWN_MACHINES = _32_BIT_MACHINES | _64_BIT_MACHINES # ELF header struct _ELF_HEADER_STRUCT = ( @@ -483,6 +484,11 @@ class Checker(object): sys.exit(2) def check_max_page_size(self, max_page_size): + if self._file_under_test.header.e_machine in _32_BIT_MACHINES: + # Skip test on 32-bit machines. 16 KB pages is an arm64 feature + # and no 32-bit systems in Android use it. + return + for alignment in self._file_under_test.alignments: if alignment % max_page_size != 0: self._error(f'Load segment has alignment {alignment} but ' |