w6l: pass reloc-kind + dyn vidx if-ladders -> switch (Wave-2 structural)

relocate() reloc-kind ladder -> switch(k): PC32+PLT32 share a
byte-identical body (comma-case), R_X86_64_64 absolute, default =
unsupported-reloc errs+=1. loadso() vidx ladder -> switch(vidx):
LOCAL not-exported, GLOBAL+BASE(1) unversioned (comma-case), default
= verdef name lookup. Regenerated w6l/main.combined.ww.
This commit is contained in:
2026-06-03 01:45:47 +09:00
parent 63e070db10
commit 9f76e816d7
3 changed files with 26 additions and 36 deletions

View File

@@ -326,22 +326,20 @@ export fn loadso(l: *lnk, path: *u8) i32 = {
keep = 0; // non-default
} else {
let vidx: u16 = v & VERSYM_VERSION_C;
if (vidx == VER_NDX_LOCAL_C) {
switch (vidx) {
case VER_NDX_LOCAL_C:
keep = 0; // not exported
} else { if (vidx == VER_NDX_GLOBAL_C) {
case VER_NDX_GLOBAL_C,1u16:
// glibc's BASE entry (vidx==1): treat as
// unversioned. (The C version notes that
// vidx==1 in Verdef maps to the SONAME BASE.)
vernamecs = nil;
} else { if (vidx == 1u16) {
// glibc's BASE entry: treat as
// unversioned. (The C version
// notes that vidx==1 in Verdef
// maps to the SONAME BASE.)
vernamecs = nil;
} else {
case:
if (verstr != nil) {
let nm: *u8 = vdnameat(buf, verdefoff, verdefsize, verstr, vidx);
vernamecs = nm;
};
}; }; };
};
};
};