Skip to content

Commit 90fda04

Browse files
committed
6l: call dwarfaddfrag when registering D_FILE symbols
ftab (the file fragment table used by dwarf.c's decodez()) was never populated, causing every z entry lookup to fail with "corrupt z entry". Register each new SFILE symbol's fragment string into ftab via dwarfaddfrag() at the same point histgen is assigned. https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
1 parent 69d4481 commit 90fda04

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sys/src/cmd/6l/obj.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#define EXTERN
22
#include "l.h"
33
#include "../ld/elf.h"
4+
#include "../ld/dwarf.h"
45
#include <ar.h>
56

67
#ifndef DEFAULT
@@ -854,6 +855,7 @@ ldobj(int f, long c, char *pn)
854855
histgen++;
855856
s->type = SFILE;
856857
s->value = histgen;
858+
dwarfaddfrag(s->value, s->name+1);
857859
}
858860
if(histfrogp < MAXHIST) {
859861
histfrog[histfrogp] = s;

0 commit comments

Comments
 (0)