From cba95c2d81193ba6ffc5fa53971ea460140d7f28 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Fri, 18 Mar 2011 09:31:56 -0700 Subject: find_matching_file returns ElfXX_Phdr *; enables optimization. --- backtrace-symbols.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backtrace-symbols.c b/backtrace-symbols.c index 8c6ab9a..0176e3f 100644 --- a/backtrace-symbols.c +++ b/backtrace-symbols.c @@ -239,11 +239,11 @@ static char **process_file( #define MAX_DEPTH 16 -struct file_match { - char const *file; - void const *address; - void const *base; - void const *hdr; +struct file_match { /* INput or OUTput w.r.t. find_matching_file() */ + char const *file; /* OUT */ + void const *address; /* IN */ + void const *base; /* OUT */ + ElfW(Phdr) const *phdr; /* OUT */ }; static int find_matching_file(struct dl_phdr_info *const info, @@ -262,6 +262,7 @@ static int find_matching_file(struct dl_phdr_info *const info, /* we found a match */ match->file = info->dlpi_name; match->base = (void *) info->dlpi_addr; + match->phdr = phdr; return 1; /* first match is good enough */ } } -- cgit