summaryrefslogtreecommitdiff
path: root/src/cmd/ld
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2014-07-11 15:16:00 +0000
committerRob Pike <r@golang.org>2014-07-11 15:16:00 +0000
commit0738227b83ab6f27aebb9a39150ea10ba4b4eb84 (patch)
treebd55b9c6b18625041784d56ef7e066ae74ddb2e6 /src/cmd/ld
parent164d4efe814b88c1a90be1bba289004244c4bd69 (diff)
downloadgo-0738227b83ab6f27aebb9a39150ea10ba4b4eb84.tar.gz
ld: change DWARF output for structs
The debug/dwarf package cannot parse the format generated here, but the format can be changed so it does. After this edit, tweaking the expression defining the offset of a struct field, the dwarf package can parse the tables (again?). LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/105710043
Diffstat (limited to 'src/cmd/ld')
-rw-r--r--src/cmd/ld/dwarf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cmd/ld/dwarf.c b/src/cmd/ld/dwarf.c
index a9f932993..90c6725bc 100644
--- a/src/cmd/ld/dwarf.c
+++ b/src/cmd/ld/dwarf.c
@@ -835,11 +835,8 @@ newmemberoffsetattr(DWDie *die, int32 offs)
int i;
i = 0;
- if (offs != 0) {
- block[i++] = DW_OP_consts;
- i += sleb128enc(offs, block+i);
- block[i++] = DW_OP_plus;
- }
+ block[i++] = DW_OP_plus_uconst;
+ i += uleb128enc(offs, block+i);
newattr(die, DW_AT_data_member_location, DW_CLS_BLOCK, i, mal(i));
memmove(die->attr->data, block, i);
}