I have a simple source : ---- test.s ---------------------- .syntax unified .arch armv7-a .fpu vfpv3-d16 .thumb .file "test.c" .global a .data .align 2 .type a, %object .size a, 4 a: .word 2330 .section .note.GNU-stack,"",%progbits ----------------------------------- Compile it: gcc -D_REENTRANT -DU_ATTRIBUTE_DEPRECATED= -O2 -g -march=armv7-a -mfloat-abi=hard -mthumb -mabi=aapcs-linux -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -c -DPIC -fPIC -o test.o test.s gcc -O2 -g -march=armv7-a -mfloat-abi=hard -mthumb -mabi=aapcs-linux -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -shared -Wl,-Bsymbolic -nodefaultlibs -nostdlib -o test.so test.o -Wl,-Bsymbolic So Flags is rewrited to 'soft-float': readelf -a test.so |grep Flags Flags: 0x5000200, Version5 EABI, soft-float ABI Key to Flags: If specify explicitly .eabi_attribute here: ------ test1.s ------------------- .syntax unified .arch armv7-a .eabi_attribute 28, 1 .fpu vfpv3-d16 .thumb .file "test.c" .global a .data .align 2 .type a, %object .size a, 4 a: .word 2330 .section .note.GNU-stack,"",%progbits ---------------------------------------------- it will work correctly now: readelf -a test1.so |grep Flags Flags: 0x5000400, Version5 EABI, hard-float ABI Key to Flags:
This is nothing to do with the compiler. Attributes are derived from annotations in the assembly file (GCC generates assembly code when compiling C/C++/Fortran, etc and puts the relevant annotations in for you, but can't do that for assembler source). If you write assembly code, you'll have to manually attribute your source code.