diff options
author | Victor Berchet <berchet@google.com> | 2022-04-15 16:20:27 +0000 |
---|---|---|
committer | Victor Berchet <berchet@google.com> | 2022-04-15 19:01:25 +0000 |
commit | a93287ee5e39a20820d025a0a73144f7daef4ed0 (patch) | |
tree | 88e8ca6bc5ac44eea574c7703af039f2fb3d6288 | |
parent | c0a1203c936613d67eddaaa46aeb2c0d8113ccdb (diff) | |
download | chre-a93287ee5e39a20820d025a0a73144f7daef4ed0.tar.gz |
Revert "Revert changes to the nanoapp loader"
This reverts commit 58cd1ac1ce556a51a2dc4f1332383f9f702f9f92.
Reason for revert: The prebuilts have been updated
Change-Id: I6fe82e8a31ef8f6387804ab9bf3ee9d57ae33bbc
-rw-r--r-- | platform/shared/nanoapp_loader.cc | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/platform/shared/nanoapp_loader.cc b/platform/shared/nanoapp_loader.cc index 3dd32a71..0f366c1c 100644 --- a/platform/shared/nanoapp_loader.cc +++ b/platform/shared/nanoapp_loader.cc @@ -53,24 +53,6 @@ NanoappLoader *gCurrentlyLoadingNanoapp = nullptr; //! Indicates whether a failure occurred during static initialization. bool gStaticInitFailure = false; -// The new operator is used by singleton.h which causes the delete operator to -// be undefined in nanoapp binaries even though it's unused. Define this in case -// a nanoapp actually tries to use the operator. -void deleteOverride(void *ptr) { - FATAL_ERROR("Nanoapp tried to free %p through delete operator", ptr); -} - -// From C++17, a call to the overloaded delete operator aimed at safely freeing -// over-aligned allocations maybe present in the nanoapp binary even though it -// is unused. Since all memory allocations/deallocations are managed by CHRE, -// signal a fatal error if the nanoapp tries to use this version of the delete -// operator. -void deleteAlignedOverride(void *ptr, std::align_val_t alignment) { - UNUSED_VAR(alignment); - - FATAL_ERROR("Nanoapp tried to free aligned %p via the delte operator", ptr); -} - // atexit is used to register functions that must be called when a binary is // removed from the system. int atexitOverride(void (*function)(void)) { @@ -184,8 +166,7 @@ const ExportedData gExportedData[] = { /* libc overrides and symbols */ ADD_EXPORTED_C_SYMBOL(__cxa_pure_virtual), ADD_EXPORTED_SYMBOL(atexitOverride, "atexit"), - ADD_EXPORTED_SYMBOL(deleteOverride, "_ZdlPv"), - ADD_EXPORTED_SYMBOL(deleteAlignedOverride, "_ZdlPvSt11align_val_t"), + ADD_EXPORTED_C_SYMBOL(dlsym), ADD_EXPORTED_C_SYMBOL(isgraph), ADD_EXPORTED_C_SYMBOL(memcmp), |