You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would pass out references to Syms, which are byte-casted from a backing &[u8]; and have a new -> Result api (which validates the bounds). We'd need two for elf32 and elf64 probably; or we can initialize as 32 or 64 bit (or pass a container context, which has less boolean blindness). This will be tricky and annoying I think due to type name punning stuff, so probably easiest to just add two typed versions and re-export it
Similar to strtab, I would also want it to implement Index, so it can be literally drop-in replaced in code that previously used a &[Sym].
Another approach could just provide a newtype wrapper on &[Sym] that validates the backing bytes and a count provided, and then Derefs to a &[Sym] so we get indexing for free.
Lots of options.
If we want to get fancy-pantsy, we might be able generify it to both ELF and Mach symbols, and have it return references via something like:
get::<Symbol>(index) -> Result<&Symbol>
but that might not be worth the effort.
The text was updated successfully, but these errors were encountered:
It would pass out references to
Sym
s, which are byte-casted from a backing&[u8]
; and have anew -> Result
api (which validates the bounds). We'd need two for elf32 and elf64 probably; or we can initialize as 32 or 64 bit (or pass a container context, which has less boolean blindness). This will be tricky and annoying I think due to type name punning stuff, so probably easiest to just add two typed versions and re-export itSimilar to strtab, I would also want it to implement
Index
, so it can be literally drop-in replaced in code that previously used a&[Sym]
.Another approach could just provide a newtype wrapper on
&[Sym]
that validates the backing bytes and a count provided, and thenDeref
s to a&[Sym]
so we get indexing for free.Lots of options.
If we want to get fancy-pantsy, we might be able generify it to both ELF and Mach symbols, and have it return references via something like:
get::<Symbol>(index) -> Result<&Symbol>
but that might not be worth the effort.
The text was updated successfully, but these errors were encountered: