Skip to content

Commit 1d27e6d

Browse files
committed
extract_utils: implement clear_symbol_version() blob fixup
Change-Id: I23190f0b83c9e28aa2624a7575544b0eaf5c83c8
1 parent 9d6037e commit 1d27e6d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

extract_utils/fixups_blob.py

+17
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,23 @@ def remove_needed(self, lib: str) -> blob_fixup:
135135
impl = partial(self.remove_needed_impl, lib)
136136
return self.call(impl)
137137

138+
def clear_symbol_version_impl(
139+
self,
140+
symbol: str,
141+
ctx: BlobFixupCtx,
142+
file: File,
143+
file_path: str,
144+
*args,
145+
**kwargs,
146+
):
147+
run_cmd(
148+
[self.__patchelf_path, '--clear-symbol-version', symbol, file_path]
149+
)
150+
151+
def clear_symbol_version(self, symbol: str) -> blob_fixup:
152+
impl = partial(self.clear_symbol_version_impl, symbol)
153+
return self.call(impl)
154+
138155
def fix_soname_impl(
139156
self, ctx: BlobFixupCtx, file: File, file_path: str, *args, **kwargs
140157
):

templates/single-device-py/extract-files.py

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def blob_fixup_return_1(
8787
.add_needed('to_add.so')
8888
.remove_needed('to_remove.so')
8989
.replace_needed('from.so', 'to.so')
90+
.clear_symbol_version('rpc_call_invoke')
9091
.binary_regex_replace(b'\xFF\x00\x00\x94', b'\xFE\x00\x00\x94')
9192
.sig_replace('C0 03 5F D6 ?? ?? ?? ?? C0 03 5F D6', '1F 20 03 D5')
9293
.call(blob_fixup_return_1, 'license_check'),

0 commit comments

Comments
 (0)