extended_image_info: Add text_delta field
Needed to offset a symbol address read from the symbol table to the actual load address.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
typedef struct extended_image_info {
|
typedef struct extended_image_info {
|
||||||
image_info basic_info;
|
image_info basic_info;
|
||||||
|
ssize_t text_delta;
|
||||||
void* symbol_table;
|
void* symbol_table;
|
||||||
void* symbol_hash;
|
void* symbol_hash;
|
||||||
void* string_table;
|
void* string_table;
|
||||||
|
|||||||
@@ -2065,6 +2065,7 @@ elf_load_user_image(const char *path, Team *team, int flags, addr_t *entry)
|
|||||||
// the runtime loader is loaded, so this is good enough for the time
|
// the runtime loader is loaded, so this is good enough for the time
|
||||||
// being.
|
// being.
|
||||||
|
|
||||||
|
imageInfo.text_delta = delta;
|
||||||
imageInfo.symbol_table = image->syms;
|
imageInfo.symbol_table = image->syms;
|
||||||
imageInfo.symbol_hash = image->symhash;
|
imageInfo.symbol_hash = image->symhash;
|
||||||
imageInfo.string_table = image->strtab;
|
imageInfo.string_table = image->strtab;
|
||||||
|
|||||||
@@ -1612,6 +1612,7 @@ team_create_thread_start_internal(void* args)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
imageInfo.basic_info.text = team->commpage_address;
|
imageInfo.basic_info.text = team->commpage_address;
|
||||||
|
imageInfo.text_delta = 0;
|
||||||
imageInfo.symbol_table = NULL;
|
imageInfo.symbol_table = NULL;
|
||||||
imageInfo.symbol_hash = NULL;
|
imageInfo.symbol_hash = NULL;
|
||||||
imageInfo.string_table = NULL;
|
imageInfo.string_table = NULL;
|
||||||
|
|||||||
@@ -522,6 +522,7 @@ register_image(image_t* image, int fd, const char* path)
|
|||||||
info.basic_info.data_size = dataEnd - dataBase;
|
info.basic_info.data_size = dataEnd - dataBase;
|
||||||
info.basic_info.api_version = image->api_version;
|
info.basic_info.api_version = image->api_version;
|
||||||
info.basic_info.abi = image->abi;
|
info.basic_info.abi = image->abi;
|
||||||
|
info.text_delta = image->regions[0].delta;
|
||||||
info.symbol_table = image->syms;
|
info.symbol_table = image->syms;
|
||||||
info.symbol_hash = image->symhash;
|
info.symbol_hash = image->symhash;
|
||||||
info.string_table = image->strtab;
|
info.string_table = image->strtab;
|
||||||
|
|||||||
Reference in New Issue
Block a user