<dirbaio[m]>
this seems a bug of the asm pretty printer though. so maybe there's two bugs here
<thejpster[m]>
For 879 maybe we could urlencode instead of hex encode?
<thejpster[m]>
Uh, I mean 878
<dirbaio[m]>
we could yeah
<dirbaio[m]>
but
<dirbaio[m]>
% itself might be a problematic character in symbol names
<dirbaio[m]>
* % itself might be a problematic character in symbol names, because it's usually not found in identifiers
<dirbaio[m]>
same with base64 +/
<dirbaio[m]>
or even - in url-safe base64
<dirbaio[m]>
my thought process in choosing hex was: if we're doing some encoding to workaround compiler bugs, we should pick one that produces symbols with really no special characters at all, to solve the problem for good
<thejpster[m]>
Encode UTF-8 into a-zA-Z0-9 and _. Base 63.
<dirbaio[m]>
like, even spaces are a "weird" character to have in symbol names
<dirbaio[m]>
but percent-encoding spaces makes the symbol names quite unreadable already
<dirbaio[m]>
dunno
<dirbaio[m]>
but it still feels dirty to have to encode as a workaround :(
<dirbaio[m]>
which is why I was looking into the bug, hoping it could be fixable. 🥲
<thejpster[m]>
> Unless quoted, symbol names start with a letter, underscore, or point and may include any letters, underscores, digits, points, and hyphens.
<thejpster[m]>
I guess it only has to work on LLD, LD and LINK.EXE. it’s a short list we have to test.
<thejpster[m]>
If it doesn’t work on the IRIX MIPSPro linker I can deal with it.
<dirbaio[m]>
it's not a linker issue, it's in llvm codegen :P
<thejpster[m]>
Oh right so you can use sym in asm!
<dirbaio[m]>
(but yeah linkers are another component in the chain that can potentially explode with "fun" symbol names...)
<thejpster[m]>
I was thinking about the Mac linker shouting at me
<thejpster[m]>
Technically it doesn’t have to be in the symbol name
<thejpster[m]>
Pretty sure you can read the variable contents out of the ELF
<thejpster[m]>
It could just be named ISTR and let the mangler have at it.
<thejpster[m]>
Then it’s even easier to make the interning go away. You just make the section LOAD instead of NOLOAD. The downside is you burn up addresses more quickly and might need to exceed 64K.
<thejpster[m]>
But then interned IDs should probably be varints anyway
<dirbaio[m]>
if the string indices get larger than 16bit you can't fit them in a movw instruction anyway
<dirbaio[m]>
so there'd be no code size savings
<thejpster[m]>
64K is a lot of format string
<dirbaio[m]>
my firmware has 791 format strings, totaling 120kb if you add up all the jsons
RockBoynton[m] has quit [Quit: Idle timeout reached: 172800s]