void *start_text_libsimgrid;
void *start_plt_libsimgrid, *end_plt_libsimgrid;
+void *start_got_plt_libsimgrid, *end_got_plt_libsimgrid;
void *start_plt_binary, *end_plt_binary;
+void *start_got_plt_binary, *end_got_plt_binary;
char *libsimgrid_path;
void *start_data_libsimgrid, *start_bss_libsimgrid;
void *start_data_binary, *start_bss_binary;
size_t n = 0; /* Amount of bytes to read by getline */
char *lfields[7];
- int i, plt_not_found = 1;
+ int i, plt_found = 0;
unsigned long int size, offset;
if(libsimgrid_path == NULL)
xbt_abort();
}
- while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) {
+ while ((read = getline(&line, &n, fp)) != -1 && plt_found != 2) {
if(n == 0)
continue;
offset = strtoul(lfields[5], NULL, 16);
start_plt_libsimgrid = (char *)start_text_libsimgrid + offset;
end_plt_libsimgrid = (char *)start_plt_libsimgrid + size;
- plt_not_found = 0;
- }
+ plt_found++;
+ }else if(strcmp(lfields[1], ".got.plt") == 0){
+ size = strtoul(lfields[2], NULL, 16);
+ offset = strtoul(lfields[5], NULL, 16);
+ start_got_plt_libsimgrid = (char *)start_text_libsimgrid + offset;
+ end_got_plt_libsimgrid = (char *)start_got_plt_libsimgrid + size;
+ plt_found++;
+ }
+
}
}
size_t n = 0; /* Amount of bytes to read by getline */
char *lfields[7];
- int i, plt_not_found = 1;
- unsigned long int size, offset;
+ int i, plt_found = 0;
+ unsigned long int size;
char *command = bprintf( "objdump --section-headers %s", xbt_binary_name);
xbt_abort();
}
- while ((read = getline(&line, &n, fp)) != -1 && plt_not_found == 1) {
+ while ((read = getline(&line, &n, fp)) != -1 && plt_found != 2) {
if(n == 0)
continue;
if(i>=6){
if(strcmp(lfields[1], ".plt") == 0){
size = strtoul(lfields[2], NULL, 16);
- offset = strtoul(lfields[5], NULL, 16);
- start_plt_binary = (char *)start_text_binary + offset;
+ start_plt_binary = (void *)strtoul(lfields[3], NULL, 16);
end_plt_binary = (char *)start_plt_binary + size;
- plt_not_found = 0;
- }
+ plt_found++;
+ }else if(strcmp(lfields[1], ".got.plt") == 0){
+ size = strtoul(lfields[2], NULL, 16);
+ start_got_plt_binary = (char *)strtoul(lfields[3], NULL, 16);
+ end_got_plt_binary = (char *)start_got_plt_binary + size;
+ plt_found++;
+ }
}