if (stat(filename, &decoy) == 0) {
ba->type = get_binary_type(filename);
- get_build_dir(builddir, filename);
+ if (ba->type != BINARY_TYPE_UNKNOWN)
+ get_build_dir(builddir, filename);
if (builddir[0] != '\0')
snprintf(binpath, sizeof(binpath), check_windows_path(builddir) ?
if (new->type == BINARY_TYPE_FILE_NOT_EXIST) {
error_code = ERR_WRONG_MESSAGE_DATA;
LOGW("binary file not exists <%s>\n", str);
+ } else if (new->type == BINARY_TYPE_UNKNOWN) {
+ error_code = ERR_WRONG_MESSAGE_DATA;
+ LOGW("binary is not ELF binary <%s>\n", str);
}
+
if (new->binpath[0] == '\0')
LOGW("section '.debug_str' not found in <%s>\n", str);
acks[i] = new;
enum binary_type_t {
BINARY_TYPE_NO_PIE = 0,
BINARY_TYPE_PIE = 1,
- BINARY_TYPE_UNKNOWN,
- BINARY_TYPE_FILE_NOT_EXIST = 0xFFFFFFFF
+ BINARY_TYPE_UNKNOWN = -2,
+ BINARY_TYPE_FILE_NOT_EXIST = -1
};
uint32_t get_binary_type(const char *path);