Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Relocs Setting and Printing #938

Merged
merged 4 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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