From: Pedro Alves <palves@redhat.com>
To: Norbert Lange <nolange79@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][PR build/24805] Explicitly export symbols from gdb_proc_service
Date: Tue, 14 Jan 2020 15:47:00 -0000 [thread overview]
Message-ID: <c1a3a253-5b8f-025d-0a3a-a92fe49583a9@redhat.com> (raw)
In-Reply-To: <CADYdroOYYikB6bsi1J5+4HqVviDKdVF7OzzR4HYRaAWG0bqLOA@mail.gmail.com>
On 1/6/20 11:39 PM, Norbert Lange wrote:
> Am Mo., 6. Jan. 2020 um 20:21 Uhr schrieb Pedro Alves <palves@redhat.com>:
>>
>> On 1/4/20 8:20 PM, Norbert Lange wrote:
>>> Compiling GDB with '-fvisibility=hidden' will remove the
>>> symbols that should be exported.
>>> This patch explicitly marks them as visible.
>>
>> Curious. We have gdb/proc-service.list supposedly for this,
>> doesn't -Wl,--dynamic-list work with -fvisibility=hidden then?
>>
>
> Obviously it doesn't, else I would not have spent time figuring out
> why libthread_db wont load.
OK. Haven't looked at visibility issues in years. It also wasn't clear
to me whether the issue could be that -Wl,--dynamic-list wasn't used
in your build for some reason, maybe related to how you're configuring GDB.
> -Wl,--dynamic-list merely filters the visible symbols, it does not see
> "hidden" ones.
BTW, you didn't post an actual patch to the list:
https://sourceware.org/ml/gdb-patches/2020-01/msg00083.html
I found it in bugzilla, though.
We can't drop support for the glibc header, since that would mean
to also drop support for the Solaris version of the header, and
also for whatever other libcs that people build gdb with (e.g.,
does musl have its own version of the header with different types?).
Up until not so long ago, glibc didn't use to install the header,
that's why we keep a local copy, IIRC.
How about something like this? It's similar to your #2 at
<https://sourceware.org/bugzilla/show_bug.cgi?id=24805#c3>, but
I'm using typeof to avoid issues with different systems using
different prototypes.
From 224b74b0fab67cdf25119f16be98a80ada071a09 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Tue, 14 Jan 2020 15:30:49 +0000
Subject: [PATCH] Ensure proc-service symbols have default visibility
---
gdb/gdbsupport/gdb_proc_service.h | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/gdb/gdbsupport/gdb_proc_service.h b/gdb/gdbsupport/gdb_proc_service.h
index 3ce2ee80fa9..9872ab2bca4 100644
--- a/gdb/gdbsupport/gdb_proc_service.h
+++ b/gdb/gdbsupport/gdb_proc_service.h
@@ -170,4 +170,33 @@ EXTERN_C_POP
#endif /* HAVE_PROC_SERVICE_H */
+/* Make sure we export the needed symbols, in case GDB is built with
+ -fvisibility=hidden. */
+
+#define PS_EXPORT(SYM) \
+ __attribute__((visibility ("default"))) typeof (SYM) SYM
+
+PS_EXPORT (ps_get_thread_area);
+PS_EXPORT (ps_getpid);
+PS_EXPORT (ps_lcontinue);
+PS_EXPORT (ps_lgetfpregs);
+PS_EXPORT (ps_lgetregs);
+PS_EXPORT (ps_lsetfpregs);
+PS_EXPORT (ps_lsetregs);
+PS_EXPORT (ps_lstop);
+PS_EXPORT (ps_pcontinue);
+PS_EXPORT (ps_pdread);
+PS_EXPORT (ps_pdwrite);
+PS_EXPORT (ps_pglobal_lookup);
+PS_EXPORT (ps_pstop);
+PS_EXPORT (ps_ptread);
+PS_EXPORT (ps_ptwrite);
+
+#ifdef __sun__
+PS_EXPORT (ps_lgetxregs);
+PS_EXPORT (ps_lgetxregsize);
+PS_EXPORT (ps_lsetxregs);
+PS_EXPORT (ps_plog);
+#endif
+
#endif /* COMMON_GDB_PROC_SERVICE_H */
base-commit: 7da6a5b938b426379f61e56e259a925bedfe242b
--
2.14.5
next prev parent reply other threads:[~2020-01-14 15:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-04 20:20 Norbert Lange
2020-01-04 20:20 ` [PATCH] always export the symbols for the proc_service interface Norbert Lange
2020-01-06 16:07 ` Tom Tromey
2020-01-06 23:22 ` Norbert Lange
2020-01-06 19:21 ` [PATCH][PR build/24805] Explicitly export symbols from gdb_proc_service Pedro Alves
2020-01-06 23:39 ` Norbert Lange
2020-01-14 15:47 ` Pedro Alves [this message]
2020-01-14 16:28 ` Pedro Alves
2020-01-14 16:57 ` Norbert Lange
2020-01-16 19:56 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c1a3a253-5b8f-025d-0a3a-a92fe49583a9@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=nolange79@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox