ARM assembly: “missing .note.GNU-stack section implies executable stack” with recent ld #1434

issue real-or-random openend this issue on October 26, 2023
  1. real-or-random commented at 4:46 pm on October 26, 2023: contributor

    Recent ld versions emit this warning when linking the (object file) created from ARM assembly:

    0/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: warning: field_10x26_arm.o: missing .note.GNU-stack section implies executable stack
    1/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    

    “Executable stack” sounds like something we should try to avoid.

    To reproduce, try ./configure --host=arm-linux-gnueabihf --enable-experimental --with-asm=arm32 (e.g, in the CI image):

     0root@ad8b1ab4bedc:/tmp/secp256k1# make
     1make  all-am
     2make[1]: Entering directory '/tmp/secp256k1'
     3  CC       src/bench-bench.o
     4  CC       src/libsecp256k1_la-secp256k1.lo
     5  CCAS     src/asm/field_10x26_arm.lo
     6  CCLD     libsecp256k1_common.la
     7  CC       src/libsecp256k1_precomputed_la-precomputed_ecmult.lo
     8  CC       src/libsecp256k1_precomputed_la-precomputed_ecmult_gen.lo
     9  CCLD     libsecp256k1_precomputed.la
    10  CCLD     libsecp256k1.la
    11/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: warning: field_10x26_arm.o: missing .note.GNU-stack section implies executable stack
    12/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    13  CCLD     bench
    14  CC       src/bench_internal-bench_internal.o
    15  CCLD     bench_internal
    16/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: warning: field_10x26_arm.o: missing .note.GNU-stack section implies executable stack
    17/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    18  CC       src/bench_ecmult-bench_ecmult.o
    19  CCLD     bench_ecmult
    20/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: warning: field_10x26_arm.o: missing .note.GNU-stack section implies executable stack
    21/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    22  CC       src/noverify_tests-tests.o
    23  CCLD     noverify_tests
    24/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: warning: field_10x26_arm.o: missing .note.GNU-stack section implies executable stack
    25/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    26  CC       src/tests-tests.o
    27  CCLD     tests
    28/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: warning: field_10x26_arm.o: missing .note.GNU-stack section implies executable stack
    29/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    30  CC       src/ctime_tests-ctime_tests.o
    31  CCLD     ctime_tests
    32  CC       src/exhaustive_tests-tests_exhaustive.o
    33  CCLD     exhaustive_tests
    34/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: warning: field_10x26_arm.o: missing .note.GNU-stack section implies executable stack
    35/usr/lib/gcc-cross/arm-linux-gnueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    36make[1]: Leaving directory '/tmp/secp256k1'
    37
    38
    39root@ad8b1ab4bedc:/tmp/secp256k1# ld -version
    40GNU ld (GNU Binutils for Debian) 2.40
    41Copyright (C) 2023 Free Software Foundation, Inc.
    42This program is free software; you may redistribute it under the terms of
    43the GNU General Public License version 3 or (at your option) a later version.
    44This program has absolutely no warranty.```
    
  2. real-or-random added the label assurance on Oct 26, 2023
  3. real-or-random added the label build on Oct 26, 2023
  4. fanquake referenced this in commit 33dc7e4d3e on Nov 13, 2023
  5. fanquake cross-referenced this on Nov 13, 2023 from issue asm: add .note.GNU-stack section for non-exec stack by fanquake
  6. real-or-random closed this on Nov 16, 2023

  7. real-or-random referenced this in commit e72103932d on Nov 16, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me