[PATCH] D27988: [LLD] Combine read-only and writable input sections into single output section

Mark Kettenis via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 03:27:31 PST 2016


> From: Rafael Avila de Espindola <rafael.espindola at gmail.com>
> Date: Tue, 20 Dec 2016 18:27:16 -0500
> 
> I don't think this is correct in general.
> 
> The spec just says
> 
> ------------------------------------------------
> In the first phase, input sections that match in name, type and
> attribute flags should be concatenated into single sections.
> ----------------------------------------------

Just tested what the Solaris ld does, and it doesn't concatenate the
two sections either.  So this seems to be a peculiarity of ld.bfd
(didn't check what ld.gold does here).

> Can you change the crt files instead? If we must do this it should
> probably be behind an off by default option.

Yes.  I can fix the OpenBSD crtbegin.o, and that's what I'll do.

The divergence in behaviour might cause some problems when people try
to do clever tricks with building sections by explicitly putting const
and non-const data in a special sections.  But that's something to
worry about when such a case is actually encountered.

Consider this diff withdrawn.  Thanks for the review,

Mark


More information about the llvm-commits mailing list