diff mbox

PING: PATCH: PR target/46770: Use .init_array/.fini_array sections

Message ID CAMe9rOoq52MYN-+y6q3zKRLhwVH1fCibW42RQeOsphjcf3P+ng@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu Aug. 22, 2011, 2:45 p.m. UTC
On Mon, Aug 22, 2011 at 7:06 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Aug 21, 2011 at 10:37 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>> On Sun, Aug 21, 2011 at 05:09:59PM -0700, H.J. Lu wrote:
>>> I didn't know .init_array section was enabled for AIX.  Does this patch
>>> work for you?
>>
>> Some ELF targets (e.g. arm*-linux*) don't use elfos.h.  IMHO you should
>> instead add
>> #ifndef __ELF__
>> #error NonELF
>> #endif
>> to gcc_AC_INITFINI_ARRAY test.  And/or add another test to it that tests
>> that you can actually use
>> .section .init_array
>> and it will use correct section flags for the section.
>>
>
> I will update the test.

Can I check in this patch to address AIX issue first?
I will submit a patch to test ".section .init_array" later?

Thanks.

Comments

Paolo Bonzini Aug. 22, 2011, 3:06 p.m. UTC | #1
On 08/22/2011 04:45 PM, H.J. Lu wrote:
> Can I check in this patch to address AIX issue first?
> I will submit a patch to test ".section .init_array" later?
>
> Thanks.

Yes.

Paolo
diff mbox

Patch

diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
index 74c86db..a8ecd2d 100644
--- a/gcc/acinclude.m4
+++ b/gcc/acinclude.m4
@@ -377,6 +377,9 @@  AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array su
pport,
 		 gcc_cv_initfini_array, [dnl
   if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
     AC_RUN_IFELSE([AC_LANG_SOURCE([
+#ifndef __ELF__
+#error Not an ELF OS
+#endif
 #ifdef __ia64__
 /* We turn on .preinit_array/.init_array/.fini_array support for ia64