* [PATCH] um: add __weak for exported functions
@ 2023-02-12 19:32 Johannes Berg
2023-02-12 21:34 ` Randy Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2023-02-12 19:32 UTC (permalink / raw)
To: linux-um; +Cc: Johannes Berg, Randy Dunlap
From: Johannes Berg <johannes.berg@intel.com>
If the exported glibc functions don't exist, we get link
failures. Avoid that by adding __weak so they're allowed
to not exist.
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
arch/um/os-Linux/user_syms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index fd575ecbcaec..54722c7f884f 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -39,7 +39,7 @@ EXPORT_SYMBOL(printf);
* good; so the versions of these symbols will always match
*/
#define EXPORT_SYMBOL_PROTO(sym) \
- int sym(void); \
+ int sym(void) __weak; \
EXPORT_SYMBOL(sym);
extern void readdir64(void) __attribute__((weak));
--
2.39.1
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] um: add __weak for exported functions
2023-02-12 19:32 [PATCH] um: add __weak for exported functions Johannes Berg
@ 2023-02-12 21:34 ` Randy Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2023-02-12 21:34 UTC (permalink / raw)
To: Johannes Berg, linux-um; +Cc: Johannes Berg
On 2/12/23 11:32, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> If the exported glibc functions don't exist, we get link
> failures. Avoid that by adding __weak so they're allowed
> to not exist.
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
> ---
> arch/um/os-Linux/user_syms.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
> index fd575ecbcaec..54722c7f884f 100644
> --- a/arch/um/os-Linux/user_syms.c
> +++ b/arch/um/os-Linux/user_syms.c
> @@ -39,7 +39,7 @@ EXPORT_SYMBOL(printf);
> * good; so the versions of these symbols will always match
> */
> #define EXPORT_SYMBOL_PROTO(sym) \
> - int sym(void); \
> + int sym(void) __weak; \
> EXPORT_SYMBOL(sym);
>
> extern void readdir64(void) __attribute__((weak));
--
~Randy
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-12 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-12 19:32 [PATCH] um: add __weak for exported functions Johannes Berg
2023-02-12 21:34 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).