[Bug general/25227] "eu-nm --extern" skips first symbol

2019-12-09 Thread ematsumiya at suse dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25227

--- Comment #2 from Enzo Matsumiya  ---
Hi Mark, do you have any updates here? Will you revert that specific part in
commit 66f4c37d497b? Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug general/25227] "eu-nm --extern" skips first symbol

2019-12-09 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=25227

--- Comment #3 from Mark Wielaard  ---
Created attachment 12113
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12113&action=edit
test file with symbols for objects/functions global/local TLS/UNIQUE debug,
weak, etc.

> Hi Mark, do you have any updates here?
> Will you revert that specific part in commit 66f4c37d497b? Thanks.

Sorry I got distracted by other things.
Yes, I believe that line should indeed read cnt = 0.

I was just extending your testcase as attached (gcc -g -m32 -c symbols.c) and
noticed some other small issues compared to binutils nm that I wanted to look
at.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[PATCH] debuginfod: Check the DEBUGINFOD_URLS environment variable early in client.

2019-12-09 Thread Mark Wielaard
If the debuginfod-client isn't configured we should do as little
as possible. Simply return early with ENOSYS if no servers are
configured. This means we won't check

This does change the behavior of the debuginfod_find calls slightly.
Previously we would setup and check the cache if the given build-id
was valid. Which might have provided a result if an earlier client
had run with the same cache and valid server URLs which knew about
that particular build-id. Now we don't return any cached results
unless at least one server is configured.

This prevents selinux errors when the library is used in a confined
setup.

Signed-off-by: Mark Wielaard 
---
 debuginfod/ChangeLog   |  5 +
 debuginfod/debuginfod-client.c | 20 +++-
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 10b6bfed..bb7c5687 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-09  Mark Wielaard  
+
+   * debuginfod-client.c (debuginfod_query_server): Check
+   server_urls_envvar early.
+
 2019-12-03  Mark Wielaard  
 
* debuginfod-client.c (debuginfod_query_server): Use separate
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index 302ea2dc..ab7b4e13 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -301,6 +301,16 @@ debuginfod_query_server (debuginfod_client *c,
   char target_cache_tmppath[PATH_MAX*5];
   char suffix[PATH_MAX*2];
   char build_id_bytes[MAX_BUILD_ID_BYTES * 2 + 1];
+  int rc;
+
+  /* Is there any server we can query?  If not, don't do any work,
+ just return with ENOSYS.  Don't even access the cache.  */
+  urls_envvar = getenv(server_urls_envvar);
+  if (urls_envvar == NULL || urls_envvar[0] == '\0')
+{
+  rc = -ENOSYS;
+  goto out;
+}
 
   /* Copy lowercase hex representation of build_id into buf.  */
   if ((build_id_len >= MAX_BUILD_ID_BYTES) ||
@@ -373,7 +383,7 @@ debuginfod_query_server (debuginfod_client *c,
   /* XXX combine these */
   snprintf(interval_path, sizeof(interval_path), "%s/%s", cache_path, 
cache_clean_interval_filename);
   snprintf(maxage_path, sizeof(maxage_path), "%s/%s", cache_path, 
cache_max_unused_age_filename);
-  int rc = debuginfod_init_cache(cache_path, interval_path, maxage_path);
+  rc = debuginfod_init_cache(cache_path, interval_path, maxage_path);
   if (rc != 0)
 goto out;
   rc = debuginfod_clean_cache(c, cache_path, interval_path, maxage_path);
@@ -390,14 +400,6 @@ debuginfod_query_server (debuginfod_client *c,
   return fd;
 }
 
-
-  urls_envvar = getenv(server_urls_envvar);
-  if (urls_envvar == NULL || urls_envvar[0] == '\0')
-{
-  rc = -ENOSYS;
-  goto out;
-}
-
   if (getenv(server_timeout_envvar))
 server_timeout = atoi (getenv(server_timeout_envvar));
 
-- 
2.18.1



Re: [PATCH] libdwfl: Find and handle compressed vmlinuz image.

2019-12-09 Thread Mark Wielaard
On Thu, 2019-12-05 at 15:21 +0100, Mark Wielaard wrote:
> Both the dwfl_linux_kernel_find_elf callback and the
> dwfl_linux_kernel_report_offline reporting function only handled
> vmlinix images possibly compressed with .gz, .bz2 or .xz extension.
> They did not find or handle the much more common vmlinuz compressed
> images.
> 
> It is not completely clear why we didn't up to now. Support for
> compressed ELF files was added in 2009 and the code was updated to
> to try to find the .gz, .bz2 or .xz extension variants in 2011.
> But not the vmlinuz named variant.

Testing (against systemtap) looks good. Pushed to master.

Cheers,

Mark


Re: [PATCH] debuginfod: Fix implicit conversion from 'CURLcode' to 'CURLMcode'

2019-12-09 Thread Mark Wielaard
On Wed, 2019-12-04 at 02:43 +0100, Mark Wielaard wrote:
> GCC10 warns when converting the value of one enum type into another:
> 
> debuginfod-client.c:530:24: error: implicit conversion from ‘CURLcode’
>to ‘CURLMcode’ [-Werror=enum-conversion]
>   530 |   curl_res = curl_easy_getinfo(target_handle,
>   |^
> 
> libcurl has different error code enums. The "easy" interfaces return
> a CURLcode error. The "multi" interface functions return a CURLMcode.

GCC10 is not out yet for a couple of months, but getting the error code
types correct seems like a good idea anyway. Pushed to master.

Cheers,

Mark