--- /dev/null
+START_SH = scripts/start.sh
+STOP_SH = scripts/stop.sh
+TARGET = da_manager
+DASCRIPT = da_command
+
+
+install: BINDIR = $(DESTDIR)/usr/bin
+install: OPTDIR = $(DESTDIR)/opt/swap/sdk
+
#include "FileElf.h"
#include <elf.h>
#include <cerrno>
+#include <cstring>
#include "swap_debug.h"
+#include <parse_elf.h>
static int checkFhdr(const Elf32_Ehdr *fhdr)
return ret;
}
-int FileElf::getAddrPlt(const char *names[], uint32_t addrs[], size_t cnt)
+int FileElf::doGetAddrPltARM(const char *names[], uint32_t addrs[], size_t cnt)
{
- if (_fhdr.e_machine != EM_ARM) {
- LOGE("mach[%lu] is not support\n", _fhdr.e_machine);
- return -EINVAL;
- }
-
int ret = makeRelocMap(R_ARM_JUMP_SLOT);
if (ret)
return ret;
return 0;
}
+int FileElf::doGetAddrPlt386(const char *names[], uint32_t addrs[], size_t cnt)
+{
+ const char *filename = this->path().c_str();
+ int ret;
+
+ ret = get_plt_addrs(filename, names, cnt, &addrs);
+ if (ret != 0) {
+ LOGE("Error getting .plt: %s\n", get_str_error(ret));
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+int FileElf::getAddrPlt(const char *names[], uint32_t addrs[], size_t cnt)
+{
+ switch (_fhdr.e_machine) {
+ case EM_ARM:
+ return doGetAddrPltARM(names, addrs, cnt);
+ case EM_386:
+ return doGetAddrPlt386(names, addrs, cnt);
+ default:
+ LOGE("mach[%lu] is not support\n", _fhdr.e_machine);
+ }
+
+ return -EINVAL;
+}
+
FileElf::FileElf()
{
}
int makeRelocMap(const uint8_t jump_slot);
const Elf32_Shdr *getShdr(const std::string &name);
+ int doGetAddrPltARM(const char *names[], uint32_t addrs[], size_t cnt);
+ int doGetAddrPlt386(const char *names[], uint32_t addrs[], size_t cnt);
+
typedef std::map <std::string, Elf32_Shdr> ShdrMap;
typedef std::map <uint32_t, std::string> RelocMap;
tmp=$(mktemp)
-# launchpad
-addr_dlopen_plt=$(su root -c "parse_elf $path_launchpad -r dlopen")
-addr_dlsym_plt=$(su root -c "parse_elf $path_launchpad -r dlsym")
# libappcore-efl.so
addr_appcore_init_plt=$(parse_elf $path_app_core_efl -r appcore_init)
# PLT
-addr_dlopen_plt=${addr_dlopen_plt:-0}
-addr_dlsym_plt=${addr_dlsym_plt:-0}
+addr_dlopen_plt=0
+addr_dlsym_plt=0
addr_appcore_init_plt=${addr_appcore_init_plt:-0}
addr_elm_run_plt=${addr_elm_run_plt:-0}