Skip to content

fix: resolve PIE moduledata pointer fields using generated offsets#121

Merged
Zxilly merged 1 commit into
goretk:developfrom
Zxilly:fix/upstream-resilience-v2
Mar 29, 2026
Merged

fix: resolve PIE moduledata pointer fields using generated offsets#121
Zxilly merged 1 commit into
goretk:developfrom
Zxilly:fix/upstream-resilience-v2

Conversation

@Zxilly
Copy link
Copy Markdown
Collaborator

@Zxilly Zxilly commented Mar 29, 2026

No description provided.

The previous commit resolved type pointer fields but applied
resolveBuffer blindly to all moduledata words, corrupting len/cap
integer fields.

- Generate pointerOffsets() on each versioned moduledata struct,
  returning byte offsets of fields that are actual pointers (from AST:
  *T, []T data ptr, uintptr, string data ptr) vs integer counts
- Add pointerOffsets() to the modulable interface
- In extractModuledata, resolve only pointer fields before binary.Read
  so derived values like TextLen = Etext - Text compute correctly
- Remove resolveBuffer (blind whole-struct resolution)
- Replace findModuledataByChainedFixup with generic findPointerValue
@Zxilly Zxilly merged commit 6a0b3f4 into goretk:develop Mar 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant