Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22102

ELF file generated in armv7, .o files in armv6, while using -march=armv6, why?

$
0
0

I'm trying to compile my program to armv6, but the ELF file is built for armv7, even when I use -march=armv6 option. All .o files has been compiled to armv6, only the ELF file is wrong.

Basically I'm compiling like this:

arm-linux-gnueabihf-g++ -static -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -Wa,-march=armv6 -o "Bridge"

Checking all .o files I get this:

$ readelf -a -W Bridge.o | grep Tag Tag_CPU_name: "6" Tag_CPU_arch: v6 Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-1 Tag_FP_arch: VFPv2 Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align_needed: 8-byte Tag_ABI_align_preserved: 8-byte, except leaf SP Tag_ABI_enum_size: int Tag_ABI_VFP_args: VFP registers Tag_ABI_optimization_goals: Aggressive Speed Tag_CPU_unaligned_access: v6

But checking the ELF file:

$ readelf -a -W Bridge | grep Tag Tag_CPU_name: "7-A" Tag_CPU_arch: v7 Tag_CPU_arch_profile: Application Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_FP_arch: VFPv3 Tag_Advanced_SIMD_arch: NEONv1 Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_rounding: Needed Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align_needed: 8-byte Tag_ABI_align_preserved: 8-byte, except leaf SP Tag_ABI_enum_size: int Tag_ABI_VFP_args: VFP registers Tag_CPU_unaligned_access: v6

I'm using Linaro GCC 7.2.1, and I've also tried with old versions, and different compilation flags combinations. Can someone tell me how to compile an armv6 ELF file?


Viewing all articles
Browse latest Browse all 22102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>