Skip to content

Commit

Permalink
Separate Relocs Setting and Printing (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
thestr4ng3r authored Apr 2, 2021
1 parent f610b1f commit 890c4bf
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 250 deletions.
16 changes: 0 additions & 16 deletions librz/bin/bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,22 +707,6 @@ static RzList *relocs_rbtree2list(RBNode *root) {
return res;
}

RZ_API RBNode *rz_bin_patch_relocs(RzBin *bin) {
rz_return_val_if_fail(bin, NULL);
RzBinFile *bf = rz_bin_cur(bin);
if (!bf || !bf->o) {
return NULL;
}
return rz_bin_object_patch_relocs(bf, bf->o);
}

// return a list of <const RzBinReloc> that needs to be freed by the caller
RZ_API RzList *rz_bin_patch_relocs_list(RzBin *bin) {
rz_return_val_if_fail(bin, NULL);
RBNode *root = rz_bin_patch_relocs(bin);
return root ? relocs_rbtree2list(root) : NULL;
}

RZ_API RBNode *rz_bin_get_relocs(RzBin *bin) {
rz_return_val_if_fail(bin, NULL);
RzBinObject *o = rz_bin_cur_object(bin);
Expand Down
2 changes: 1 addition & 1 deletion librz/bin/bobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ RZ_API int rz_bin_object_set_items(RzBinFile *bf, RzBinObject *o) {
return true;
}

RZ_IPI RBNode *rz_bin_object_patch_relocs(RzBinFile *bf, RzBinObject *o) {
RZ_API RBNode *rz_bin_object_patch_relocs(RzBinFile *bf, RzBinObject *o) {
rz_return_val_if_fail(bf && o, NULL);

static bool first = true;
Expand Down
1 change: 0 additions & 1 deletion librz/bin/i/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ RZ_IPI void rz_bin_object_filter_strings(RzBinObject *bo);
RZ_IPI RzBinObject *rz_bin_object_new(RzBinFile *binfile, RzBinPlugin *plugin, ut64 baseaddr, ut64 loadaddr, ut64 offset, ut64 sz);
RZ_IPI RzBinObject *rz_bin_object_get_cur(RzBin *bin);
RZ_IPI RzBinObject *rz_bin_object_find_by_arch_bits(RzBinFile *binfile, const char *arch, int bits, const char *name);
RZ_IPI RBNode *rz_bin_object_patch_relocs(RzBinFile *bf, RzBinObject *o);

RZ_IPI const char *rz_bin_lang_tostring(int lang);
RZ_IPI int rz_bin_lang_type(RzBinFile *binfile, const char *def, const char *sym);
Expand Down
Loading

0 comments on commit 890c4bf

Please sign in to comment.