* @param path Path to the ELF file
* @param low_addr Base address of the executable
* @param memsz In-memory size of the executable
+ * @param is_pic Whether the executable is position independent
+ * code (PIC)
* @returns Pointer to the new so_info on success,
* NULL on failure.
*/
BT_HIDDEN
struct so_info *so_info_create(const char *path, uint64_t low_addr,
- uint64_t memsz);
+ uint64_t memsz, bool is_pic);
/**
* Destroy the given so_info instance
BT_HIDDEN
int so_info_lookup_source_location(struct so_info *so, uint64_t addr,
struct source_location **src_loc);
+/**
+ * Get a string representing the location within the binary of a given
+ * address.
+ *
+ * In the case of a PIC binary, the location is relative (+0x1234).
+ * For a non-PIC binary, the location is absolute (@0x1234)
+ *
+ * On success, the out parameter `bin_loc` is set. The ownership is
+ * passed to the caller. On failure, `bin_loc` remains unchanged.
+ *
+ * @param so so_info instance for the executable containing
+ * the address
+ * @param addr Virtual memory address for which to find the
+ * binary location
+ * @param bin_loc Out parameter, the binary location
+ * @returns 0 on success, -1 on failure
+ */
+BT_HIDDEN
+int so_info_get_bin_loc(struct so_info *so, uint64_t addr, char **bin_loc);
/**
* Destroy the given source_location instance