I see Relocation section '.rela.debug_info' at offset 0xf460 contains 852 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000000006 001d00000004 R_390_32 0000000000000000 .debug_abbrev + 0 00000000000c 006d00000004 R_390_32 0000000000000d9a .LASF336 + 0 000000000011 006e00000004 R_390_32 000000000000001c .LASF337 + 0 000000000015 006f00000004 R_390_32 000000000000069a .LASF338 + 0 000000000019 002000000004 R_390_32 0000000000000000 .debug_ranges + 570 000000000025 002100000004 R_390_32 0000000000000000 .debug_line + 0 00000000002a 007000000004 R_390_32 000000000000003d .LASF8 + 0 00000000003c 007100000004 R_390_32 00000000000005ab .LASF0 + 0 00000000004a 007200000004 R_390_32 0000000000000260 .LASF1 + 0 000000000051 007300000004 R_390_32 00000000000006f3 .LASF2 + 0 000000000058 007400000004 R_390_32 000000000000035b .LASF3 + 0 instead of 000000000058 007400000004 R_390_32 0000000000000000 .debug_str + 35b that needlessly increases .symtab size plus it confuses elflint (tools/21332).
Created attachment 9958 [details] Proposed patch Hi Richard, This patch will achieve the effect you want, although I worry that it might break something else in the s390 toolchain. I'll ping the s390 maintainers and see what they say. Cheers Nick
Should be ok for s390 as well. Given that we mimic the i386 binutils code in many other situations I don't see why we should stop here ;) Thanks for having a look!
On Fri, 31 Mar 2017, nickc at redhat dot com wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=21333 > > Nick Clifton <nickc at redhat dot com> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |nickc at redhat dot com > > --- Comment #1 from Nick Clifton <nickc at redhat dot com> --- > Created attachment 9958 [details] > --> https://sourceware.org/bugzilla/attachment.cgi?id=9958&action=edit > Proposed patch > > Hi Richard, > > This patch will achieve the effect you want, although I worry that it might > break something else in the s390 toolchain. I'll ping the s390 maintainers > and see what they say. Looks like ppc for example instead does /* Always adjust symbols in debugging sections. */ if (bfd_get_section_flags (stdoutput, symseg) & SEC_DEBUGGING) return 1; eventually gas should simply do that globally... But thanks for the fix!
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dc1e4d6dedcb8ee3bb195f0db711f6aa164b8ab4 commit dc1e4d6dedcb8ee3bb195f0db711f6aa164b8ab4 Author: Nick Clifton <nickc@redhat.com> Date: Fri Mar 31 12:54:38 2017 +0100 Reduce the size of s390 symbol tables by allowing relocations in mergeable string sections (eg .debug_str) to be made section relative rather than symbol relative. PR gas/21333 * config/tc-s390.c (tc_s390_fix_adjustable): Allow non pc-relative fixups in mergeable sections to be adjusted.
Well it looks like the patch should be OK, so I have gone ahead and applied it.