rui314 / mold

Mold: A Modern Linker 🦠
MIT License
13.69k stars 448 forks source link

Fix corrupted .riscv.attributes ISA string #1276

Closed yujincheng08 closed 3 weeks ago

yujincheng08 commented 3 weeks ago

extension name can contain digits

Fix #1275

rui314 commented 3 weeks ago

Can it start with a number? I mean I wonder if ^([a-z][a-z0-9]*)(\d+)p(\d+) is correct.

yujincheng08 commented 3 weeks ago

@rui314 I dont think it can. Your solution looks better.

rui314 commented 3 weeks ago

And it appears it cannot end with a number, as such digit cannot be distinguished with a following major version number. So I guess it should be ^([a-z]|[a-z][a-z0-9]*[a-z])(\d+)p(\d+)