public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] bfd: elflink: upstream change to garbage collection sweep causes mb regression
@ 2023-09-25 14:41 Neal Frager
  2023-09-27 16:09 ` Michael Eager
  2023-10-03 18:44 ` Michael Eager
  0 siblings, 2 replies; 3+ messages in thread
From: Neal Frager @ 2023-09-25 14:41 UTC (permalink / raw)
  To: binutils
  Cc: ibai.erkiaga-elorza, nagaraju.mekala, mark.hatle,
	sadanand.mutyala, appa.rao.nali, Neal Frager

Upstream change for PR13177 now clears the def_regular during gc_sweep of a
section. (All other archs in binutils/bfd/elf32-*.c received an update
to a warning about unresolvable relocations - this warning is not present
in binutils/bfd/elf32-microblaze.c, but this warning check would not
prevent the error being seen).

The visible issue with this change is when running a c++ application
in Petalinux which links libstdc++.so for exception handling it segfaults
on execution.

This does not occur if static linking libstdc++.a, so its during the
relocations for a shared lib with garbage collection this occurs.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 bfd/elflink.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bfd/elflink.c b/bfd/elflink.c
index ca162145f7e..0524019641e 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -6608,7 +6608,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
 
       inf = (struct elf_gc_sweep_symbol_info *) data;
       (*inf->hide_symbol) (inf->info, h, true);
-      h->def_regular = 0;
       h->ref_regular = 0;
       h->ref_regular_nonweak = 0;
     }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] bfd: elflink: upstream change to garbage collection sweep causes mb regression
  2023-09-25 14:41 [PATCH v1 1/1] bfd: elflink: upstream change to garbage collection sweep causes mb regression Neal Frager
@ 2023-09-27 16:09 ` Michael Eager
  2023-10-03 18:44 ` Michael Eager
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Eager @ 2023-09-27 16:09 UTC (permalink / raw)
  To: Neal Frager, binutils
  Cc: ibai.erkiaga-elorza, nagaraju.mekala, mark.hatle,
	sadanand.mutyala, appa.rao.nali

Hi Neal --

Thanks for the patch set.  I'll review them in the next couple days.

On 9/25/23 07:41, Neal Frager via Binutils wrote:
> Upstream change for PR13177 now clears the def_regular during gc_sweep of a
> section. (All other archs in binutils/bfd/elf32-*.c received an update
> to a warning about unresolvable relocations - this warning is not present
> in binutils/bfd/elf32-microblaze.c, but this warning check would not
> prevent the error being seen).
> 
> The visible issue with this change is when running a c++ application
> in Petalinux which links libstdc++.so for exception handling it segfaults
> on execution.
> 
> This does not occur if static linking libstdc++.a, so its during the
> relocations for a shared lib with garbage collection this occurs.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
>   bfd/elflink.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/bfd/elflink.c b/bfd/elflink.c
> index ca162145f7e..0524019641e 100644
> --- a/bfd/elflink.c
> +++ b/bfd/elflink.c
> @@ -6608,7 +6608,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
>   
>         inf = (struct elf_gc_sweep_symbol_info *) data;
>         (*inf->hide_symbol) (inf->info, h, true);
> -      h->def_regular = 0;
>         h->ref_regular = 0;
>         h->ref_regular_nonweak = 0;
>       }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] bfd: elflink: upstream change to garbage collection sweep causes mb regression
  2023-09-25 14:41 [PATCH v1 1/1] bfd: elflink: upstream change to garbage collection sweep causes mb regression Neal Frager
  2023-09-27 16:09 ` Michael Eager
@ 2023-10-03 18:44 ` Michael Eager
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Eager @ 2023-10-03 18:44 UTC (permalink / raw)
  To: Neal Frager, binutils
  Cc: ibai.erkiaga-elorza, nagaraju.mekala, mark.hatle,
	sadanand.mutyala, appa.rao.nali

On 9/25/23 07:41, Neal Frager via Binutils wrote:
> Upstream change for PR13177 now clears the def_regular during gc_sweep of a
> section. (All other archs in binutils/bfd/elf32-*.c received an update
> to a warning about unresolvable relocations - this warning is not present
> in binutils/bfd/elf32-microblaze.c, but this warning check would not
> prevent the error being seen).
> 
> The visible issue with this change is when running a c++ application
> in Petalinux which links libstdc++.so for exception handling it segfaults
> on execution.
> 
> This does not occur if static linking libstdc++.a, so its during the
> relocations for a shared lib with garbage collection this occurs.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
>   bfd/elflink.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/bfd/elflink.c b/bfd/elflink.c
> index ca162145f7e..0524019641e 100644
> --- a/bfd/elflink.c
> +++ b/bfd/elflink.c
> @@ -6608,7 +6608,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
>   
>         inf = (struct elf_gc_sweep_symbol_info *) data;
>         (*inf->hide_symbol) (inf->info, h, true);
> -      h->def_regular = 0;
>         h->ref_regular = 0;
>         h->ref_regular_nonweak = 0;
>       }

Neal --

It isn't clear what problem this patch addresses.

What update was applied to bfd/elf32-*.c for other archs?

This patch modifies code which is shared by all architectures, applied 
in a patch in 2011.  If there is a problem with this code, it seems that 
the failure would have been seen on other architectures long ago, not 
just MicroBlaze.

It seems likely that applying this patch would break other archs.

Please provide a test case which shows this problem.

-- 
Michael Eager


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-03 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 14:41 [PATCH v1 1/1] bfd: elflink: upstream change to garbage collection sweep causes mb regression Neal Frager
2023-09-27 16:09 ` Michael Eager
2023-10-03 18:44 ` Michael Eager

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 read-only IMAP folder(s) and NNTP newsgroup(s).