Red Hat Bugzilla – Bug 485940
DW_TAG_label without DW_AT_low_pc
Last modified: 2009-03-31 13:38:51 EDT
Created attachment 332235 [details]
Description of problem:
The majority of the time a DW_TAG_label has an associated DW_AT_low_pc, however in some circumstances it does not.
Version-Release number of selected component (if applicable):
Tested with both 4.3.2 and 4.4.0
Steps to Reproduce:
1. gcc -O2 -Wall -W -c xact.i -g && readelf --debug-dump xact.o | less -pstapprobe
<1220> DW_AT_name : (indirect string, offset: 0xf10): _stapprobe1_t
<1224> DW_AT_decl_file : 1
<1225> DW_AT_decl_line : 13348
<1273> DW_AT_low_pc : 0x0
Same issue can be seen with the system compiler:
$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
[ 11f8] label
But no low_pc.
.uleb128 0x1f # (DIE (0x122d) DW_TAG_label)
.long .LASF464 # DW_AT_name: "_stapprobe1_transaction__start_1550"
.byte 0x1 # DW_AT_decl_file (xact.i)
.value 0x3424 # DW_AT_decl_line
.uleb128 0x2a # (DIE (0x12fa) DW_TAG_label)
.long 0x122d # DW_AT_abstract_origin
.quad .L6 # DW_AT_low_pc
Why do you consider that a bug? That DW_TAG_label die is just the abstract origin of the label, there is another DW_TAG_label with DW_AT_abstract_origin and DW_AT_loc_pw later on. Why should we emit a DW_AT_low_pc when there isn't really one? 2.17 says:
"If an entity has no associated machine code, none of these attributes are specified."
and that's the case here.
There is no bug if all observed cases missing PC attrs are like this one.
The consumer just needs to be using smarter methods.
Closing, if you find a case where DW_TAG_label without DW_AT_low_pc doesn't have corresponding DW_TAG_label with it and pointing to it through DW_AT_abstract_origin (possibly transitively), please reopen.