diff options
author | Chad Versace <[email protected]> | 2017-09-12 15:52:03 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2017-09-13 09:49:27 -0700 |
commit | 5c98d3825ccbed9054a1bb2de607116b2b31d48b (patch) | |
tree | 08eb6cc0beb3e572b48d28f59977a878646a412b /src/intel/vulkan/anv_device.c | |
parent | c8db134e4deed596a67d9daa1827feca76d5c4c4 (diff) |
util: Query build-id by symbol address, not library name
This patch renames build_id_find_nhdr() to
build_id_find_nhdr_for_addr(), and changes it to never examine the
library name.
Tested on Fedora by confirming that build_id_get_data() returns the same
build-id as the file(1) tool. For BSD, I confirmed that the API used
(dladdr() and struct Dl_info) is documented in FreeBSD's manpages.
This solves two problems:
- We can now the query the build-id without knowing the installed library's
filename.
This matters because Android requires specific filenames for HAL
modules, such as "/vendor/lib/hw/vulkan.${board}.so". The HAL
filenames do not follow the Unix convention of "libfoo.so". In
other words, the same query code will now work on Linux and Android.
- Querying the build-id now works correctly when the process
contains multiple shared objects with the same basename.
(Admittedly, this is a highly unlikely scenario).
Cc: Jonathan Gray <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index be2455166e3..8e2ed9eac45 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -208,7 +208,8 @@ anv_physical_device_init_heaps(struct anv_physical_device *device, int fd) static VkResult anv_physical_device_init_uuids(struct anv_physical_device *device) { - const struct build_id_note *note = build_id_find_nhdr("libvulkan_intel.so"); + const struct build_id_note *note = + build_id_find_nhdr_for_addr(anv_physical_device_init_uuids); if (!note) { return vk_errorf(device->instance, device, VK_ERROR_INITIALIZATION_FAILED, |