Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 1 | From 0ee164f7e50d88e1cda4fdebd6f7bd182d0f27b3 Mon Sep 17 00:00:00 2001 |
| 2 | From: David Holsgrove <david.holsgrove@xilinx.com> |
| 3 | Date: Wed, 27 Feb 2013 13:56:11 +1000 |
| 4 | Subject: [PATCH] upstream change to garbage collection sweep causes mb |
| 5 | regression |
| 6 | |
| 7 | Upstream change for PR13177 now clears the def_regular during gc_sweep of a |
| 8 | section. (All other archs in binutils/bfd/elf32-*.c received an update |
| 9 | to a warning about unresolvable relocations - this warning is not present |
| 10 | in binutils/bfd/elf32-microblaze.c, but this warning check would not |
| 11 | prevent the error being seen) |
| 12 | |
| 13 | The visible issue with this change is when running a c++ application |
| 14 | in Petalinux which links libstdc++.so for exception handling it segfaults |
| 15 | on execution. |
| 16 | |
| 17 | This does not occur if static linking libstdc++.a, so its during the |
| 18 | relocations for a shared lib with garbage collection this occurs |
| 19 | |
| 20 | Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> |
| 21 | Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> |
| 22 | |
| 23 | --- |
| 24 | bfd/elflink.c | 1 - |
| 25 | 1 file changed, 1 deletion(-) |
| 26 | |
| 27 | diff --git a/bfd/elflink.c b/bfd/elflink.c |
| 28 | index e50c0e4..09d43e3 100644 |
| 29 | --- a/bfd/elflink.c |
| 30 | +++ b/bfd/elflink.c |
| 31 | @@ -6187,7 +6187,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data) |
| 32 | |
| 33 | inf = (struct elf_gc_sweep_symbol_info *) data; |
| 34 | (*inf->hide_symbol) (inf->info, h, TRUE); |
| 35 | - h->def_regular = 0; |
| 36 | h->ref_regular = 0; |
| 37 | h->ref_regular_nonweak = 0; |
| 38 | } |