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:
Ingo Weinhold 2016-04-29 22:16:35 +02:00
parent 571a4030ea
commit 9266cd66c7
4 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@
typedef struct extended_image_info {
image_info basic_info;
ssize_t text_delta;
void* symbol_table;
void* symbol_hash;
void* string_table;

View File

@ -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
// being.
imageInfo.text_delta = delta;
imageInfo.symbol_table = image->syms;
imageInfo.symbol_hash = image->symhash;
imageInfo.string_table = image->strtab;

View File

@ -1612,6 +1612,7 @@ team_create_thread_start_internal(void* args)
return err;
}
imageInfo.basic_info.text = team->commpage_address;
imageInfo.text_delta = 0;
imageInfo.symbol_table = NULL;
imageInfo.symbol_hash = NULL;
imageInfo.string_table = NULL;

View File

@ -522,6 +522,7 @@ register_image(image_t* image, int fd, const char* path)
info.basic_info.data_size = dataEnd - dataBase;
info.basic_info.api_version = image->api_version;
info.basic_info.abi = image->abi;
info.text_delta = image->regions[0].delta;
info.symbol_table = image->syms;
info.symbol_hash = image->symhash;
info.string_table = image->strtab;