]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcc: Use initarray section type for .init_stack
authorKewen Lin <linkw@linux.ibm.com>
Mon, 5 Jun 2023 03:39:32 +0000 (22:39 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Mon, 5 Jun 2023 03:39:32 +0000 (22:39 -0500)
One of my workmates found there is a warning like:

  libgcc/config/rs6000/morestack.S:402: Warning: ignoring
    incorrect section type for .init_array.00000

when compiling libgcc/config/rs6000/morestack.S.

Since commit r13-6545 touched that file recently, which was
suspected to be responsible for this warning, I did some
investigation and found this is a warning staying for a long
time.  For section .init_stack*, it's preferred to use
section type SHT_INIT_ARRAY.  So this patch is use
"@init_array" to replace "@progbits".

Although the warning is trivial, Segher suggested me to
post this to fix it, in order to avoid any possible
misunderstanding/confusion on the warning.

As Alan confirmed, this doesn't require a premise check
on if the existing binutils supports "@init_array" or not,
"because if you want split-stack to work, you must link
with gold, any version of binutils that has gold has an
assembler that understands @init_array". (Thanks Alan!)

libgcc/ChangeLog:

* config/i386/morestack.S: Use @init_array rather than
@progbits for section type of section .init_array.
* config/rs6000/morestack.S: Likewise.
* config/s390/morestack.S: Likewise.

libgcc/config/i386/morestack.S
libgcc/config/rs6000/morestack.S
libgcc/config/s390/morestack.S

index 7ae99b50cf5197134df612961d6d2bb866df4fd6..c822b71e2ddf12f995976f7d27839c4d413ab5c0 100644 (file)
@@ -850,7 +850,7 @@ __morestack_make_guard:
 # This is ELF specific.
 
 #if HAVE_INITFINI_ARRAY_SUPPORT
-       .section        .init_array.00000,"aw",@progbits
+       .section        .init_array.00000,"aw",@init_array
 #else
        .section        .ctors.65535,"aw",@progbits
 #endif
index f2fea6abb105b3426f049307d5ed612a0fc728a2..dd1e27cd454ae8cddfa7913bc31176f6bf938a22 100644 (file)
@@ -399,7 +399,7 @@ ENTRY0(__morestack_make_guard)
 
 # Make __stack_split_initialize a high priority constructor.
 #if HAVE_INITFINI_ARRAY_SUPPORT
-       .section .init_array.00000,"aw",@progbits
+       .section .init_array.00000,"aw",@init_array
 #else
        .section .ctors.65535,"aw",@progbits
 #endif
index 09a49bb885121e8499999061ec4054b427e8ed2c..f52e7a6510ca519abb467a585b76613d03104c41 100644 (file)
@@ -597,7 +597,7 @@ __morestack_make_guard:
 # Make __stack_split_initialize a high priority constructor.
 
 #if HAVE_INITFINI_ARRAY_SUPPORT
-       .section .init_array.00000,"aw",@progbits
+       .section .init_array.00000,"aw",@init_array
 #else
        .section .ctors.65535,"aw",@progbits
 #endif