[PATCH] elf: Strip zero-sized dynamic sections

Alan Modra amodra@gmail.com
Mon Apr 20 09:35:47 GMT 2020


On Sat, Apr 18, 2020 at 09:51:53AM -0700, H.J. Lu wrote:
> On Fri, Apr 17, 2020 at 5:26 PM Alan Modra <amodra@gmail.com> wrote:
> >
> > On Fri, Apr 17, 2020 at 10:57:04AM -0700, H.J. Lu wrote:
> > > Any ideas why ppc64 backend generates zero-sized relocation section:
> > >
> > > tmpdir/libcomm-data.so:
> > > ...
> > >   [ 5] .rela.dyn         RELA            0000000000000160 000160
> > > 000000 18   A  3   0  8
> > > ...
> > >
> > > Is this required by psABI?
> >
> > No, it just looks to be something that isn't tidied.  The .rela.dyn
> > output section is created due to .rela.branch_lt being created as a
> > dynamic section, and not being sized early enough for
> > size_dynamic_sections to set SEC_EXCLUDE.  I'll see if I can make it
> > go away.
> >
> 
> I opened:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=25849
> 
> Here is a patch.  OK for master?

I don't think readelf should warn until all ELF targets are tidied.

If someone sees a warning on alpha-linux, say, they have no way to
avoid producing object files that give a warning.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list