Hello

I've noticed that for C++ translation unit GCC for aarch64 always
emits CFI into eh_frame but never debug_frame even if debug
information is enabled. Tried on GCC versions 6 to 8.
DWARF for the ARM 64-bit architecture (AArch64) states that it must be
debug_frame ((https://static.docs.arm.com/ihi0057/b/IHI0057B_aadwarf64.pdf)
GAS supports emitting CFI to both sections by directive: .cfi_sections
   .debug_frame,.eh_frame

At the same time gcc for arm emits CFI in both debug_frame and .ARM.exidx

I'm aware about CFI for Exception Handling. But what the reason to not
emit both ?
Is there any implicit reason for that or it's just a bug ?

Steps to reproduce:

cat > test.cpp <<EOF
int foo() {
return 0;
}
EOF

./aarch64-none-elf-gcc -c -g test.cpp -o test_cpp.o &&
./aarch64-none-elf-objdump -g test_cpp.o | grep -B 3 "CIE" | grep
"_frame"
Contents of the .eh_frame section:

While for C code it does:
cat > test.c <<EOF
int foo() {
return 0;
}
EOF

./aarch64-none-elf-gcc -c -g test.c -o test_c.o &&
./aarch64-none-elf-objdump -g test_c.o | grep -B 3 "CIE" | grep
"_frame"
Contents of the .debug_frame section:


Alex

Reply via email to