And to fill the gap, 4.9 is still OK: $ gcc-4.9 dw.c -o dw.o -g -c -O2 && readelf -wi dw.o|grep -C 5 getenv <2fb> DW_AT_type : <0x264> <2ff> DW_AT_external : 1 <2ff> DW_AT_declaration : 1 <1><2ff>: Abbrev Number: 19 (DW_TAG_subprogram) <300> DW_AT_external : 1 <300> DW_AT_name : (indirect string, offset: 0x268): getenv <304> DW_AT_decl_file : 6 <305> DW_AT_decl_line : 564 <307> DW_AT_prototyped : 1 <307> DW_AT_type : <0x8b> <30b> DW_AT_declaration : 1 So it has to be something new in gcc-5.