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

issue real-or-random opened 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:

    /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
    /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):

    root@ad8b1ab4bedc:/tmp/secp256k1# make
    make  all-am
    make[1]: Entering directory '/tmp/secp256k1'
      CC       src/bench-bench.o
      CC       src/libsecp256k1_la-secp256k1.lo
      CCAS     src/asm/field_10x26_arm.lo
      CCLD     libsecp256k1_common.la
      CC       src/libsecp256k1_precomputed_la-precomputed_ecmult.lo
      CC       src/libsecp256k1_precomputed_la-precomputed_ecmult_gen.lo
      CCLD     libsecp256k1_precomputed.la
      CCLD     libsecp256k1.la
    /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
    /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
      CCLD     bench
      CC       src/bench_internal-bench_internal.o
      CCLD     bench_internal
    /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
    /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
      CC       src/bench_ecmult-bench_ecmult.o
      CCLD     bench_ecmult
    /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
    /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
      CC       src/noverify_tests-tests.o
      CCLD     noverify_tests
    /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
    /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
      CC       src/tests-tests.o
      CCLD     tests
    /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
    /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
      CC       src/ctime_tests-ctime_tests.o
      CCLD     ctime_tests
      CC       src/exhaustive_tests-tests_exhaustive.o
      CCLD     exhaustive_tests
    /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
    /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
    make[1]: Leaving directory '/tmp/secp256k1'
    
    
    root@ad8b1ab4bedc:/tmp/secp256k1# ld -version
    GNU ld (GNU Binutils for Debian) 2.40
    Copyright (C) 2023 Free Software Foundation, Inc.
    This program is free software; you may redistribute it under the terms of
    the GNU General Public License version 3 or (at your option) a later version.
    This 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: 2026-04-22 18:15 UTC

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