This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ELF: Support the section flag 'o' in .section directive
On Thu, Feb 06, 2020 at 11:23:10AM -0800, H.J. Lu wrote:
> On Wed, Feb 5, 2020 at 11:46 PM Alan Modra <amodra@gmail.com> wrote:
> > Also, for sh-linux, I see this in pr25490-2.o
> > [ 4] __patchable_function_entries PROGBITS 00000000 000038 000004 00 WAL 1 0 4
>
> 4 is sh_addralign. sh_link is 1.
Oops.
> All fixed. Here is the updated patch. The only bfd changes are
>
> * bfd-in2.h: Regenerated.
> * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
> on section if gc_mark of any of its linked-to sections is set
> and don't set gc_mark again.
> * section.c (asection): Add linked_to_symbol_name to map_head
> union.
>
> I changed _bfd_elf_gc_mark_extra_sections to call mark_hook
> instead of setting gc_mark directly.
>
> OK for master?
Yes, with these extra tweaks. m68hc12 is 32 bit, and msp430 generates
enough extra sections that the link to .foo is 10.
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 3c74a55518..7b8e8f6f3c 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -87,7 +87,7 @@ if [is_elf64 tmpdir/symbol3w.a] {
if { [istarget avr-*-*]
|| [istarget h8300-*-*]
|| [istarget ip2k-*-*]
- || [istarget "m68hc1*-*"]
+ || [istarget m68hc11-*]
|| [istarget "xc16x-*"]
|| [istarget "z80-*-*"] } {
set pr25490_2_exp "pr25490-2-16.rd"
diff --git a/ld/testsuite/ld-elf/pr24526.d b/ld/testsuite/ld-elf/pr24526.d
index 2094b17e3e..3faaa1e6f6 100644
--- a/ld/testsuite/ld-elf/pr24526.d
+++ b/ld/testsuite/ld-elf/pr24526.d
@@ -3,7 +3,7 @@
#readelf: -SW
#...
- +\[ *[0-9]+\] \.bar +PROGBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +AL +[0-9] .*
+ +\[ *[0-9]+\] \.bar +PROGBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +AL .*
#...
- +\[ *[0-9]+\] \.zed +PROGBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +AL +[0-9] .*
+ +\[ *[0-9]+\] \.zed +PROGBITS +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +00 +AL .*
#pass
--
Alan Modra
Australia Development Lab, IBM