Is the presence of DW_OP_GNU_uninit in an object file compiled with
-gstrict-dwarf correct?

I am using the arm-none-eabi toolchain and compiling with the following:

arm-none-eabi-gcc -r -mlong-calls -fno-exceptions -march=armv6-m \
-O2 -Wall \
-g3 -gdwarf-4 -gstrict-dwarf \
-c main.c


Inspecting the object file with readelf:

arm-none-eabi-readelf --debug-dump=loc main.o | grep -i 'DW_OP_GNU_'

I see DW_OP_GNU_uninit:

    00004a65 00000e00 00000e42 (DW_OP_reg1 (r1); DW_OP_GNU_uninit)
    00004a71 00000e4c 00000e4e (DW_OP_reg1 (r1); DW_OP_GNU_uninit)
    00004a7d 00000e52 00000e98 (DW_OP_reg1 (r1); DW_OP_GNU_uninit)
    00004a89 00000eca 00000ed9 (DW_OP_reg1 (r1); DW_OP_GNU_uninit)

There are no other GNU operators in the object file. Given that the
'-gstrict-dwarf' has been specified I don't expect DW_OP_GNU_uninit to be
emitted. Is this current behaviour correct? Am I doing something wrong?

Version information:

arm-none-eabi-gcc (Arm GNU Toolchain 15.3.Rel1 (Build arm-15.149)) 15.3.1
20260627
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


I can provide a link to the source if required.

Thanks,
Stephen Illingworth

Reply via email to