rtld: make token substitution table-driven
(cherry picked from commit 55abf23dd36b2fa1499bd6806ce4c9510f7a4ee5)