Open
Description
The goal is to drop the reset function as pointed here.
For this we can do the following (inspired by changes in lld/ELF & https://maskray.me/blog/2024-11-17-removing-global-state-from-lld)
- Move driver into ctx and add LinkerDriver::ctx
- f596d82#diff-5514d8102381f1f4b47bfb1caf0b7c06bbc3b3d2677c6844d0001eb022b64d88
- bffb26f#diff-5514d8102381f1f4b47bfb1caf0b7c06bbc3b3d2677c6844d0001eb022b64d88R94
- Move Config into ctx and migrate LinkerDriver member functions to use
ctx.arg.x
instead of
config->x
- Add Context aware diagnostic functions
- Pass ctx to bAlloc/saver/uniqueSaver
- a626eb2#diff-5514d8102381f1f4b47bfb1caf0b7c06bbc3b3d2677c6844d0001eb022b64d88R109
- 2991a4e#diff-ba5e9bcbcabe54e23f58f9466afb49d9720373eb11b9b3a42ddc2d653b035594
- Miscallaneous like
- Move symtab into ctx (df0864e#diff-9e4503a72c1e0c0a2743852386d5e9a99574f6e6a25be24160269e729fb1e433)
- Pass ctx to InputFiles (4986510_
- etc
- Finally we can get rid of reset and the ctx global variable . Also let Ctx inherit from CommonLinkerContext