ARM-software / optimized-routines

Optimized implementations of various library functions for ARM architecture processors
Other
592 stars 94 forks source link

aarch64: corrupt GNU_PROPERTY_TYPE (5) size: 0x10 #56

Closed sebhub closed 1 year ago

sebhub commented 1 year ago

The macro in asmdefs.h produces a warning for aarch64 using -mabi=ilp32:

/* Add a NT_GNU_PROPERTY_TYPE_0 note.  */
#define GNU_PROPERTY(type, value)       \
  .section .note.gnu.property, "a";     \
  .p2align 3;                           \
  .word 4;                              \
  .word 16;                             \
  .word 5;                              \
  .asciz "GNU";                         \
  .word type;                           \
  .word 4;                              \
  .word value;                          \
  .word 0;                              \
  .text

BFD: warning: libc/machine/aarch64/libc_a-memchr.o: corrupt GNU_PROPERTY_TYPE (5) size: 0x10

Here is the output of readelf -n:

File: libc.a(libc_a-memchr.o)

Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: BTI, PAC
        <corrupt descsz: 0x10>

Without the -mabi=ilp32 I get no warning and this output:

File: libc.a(libc_a-memchr.o)

Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: BTI, PAC

I used GNU Binutils 2.41.50.20230727 and GCC 13.2.

nsz-arm commented 1 year ago

yes, this seems to be a bug.

i can fix it or apply your fix, but in the latter case you have to submit the https://github.com/ARM-software/optimized-routines/blob/master/contributor-agreement.pdf form.

sebhub commented 1 year ago

Thanks, we will submit the contributor agreement.