The current code would build up a map of ELF symbols when
first parsing the ELF for quick lookup later on when we
patch/read certain symbols. In this process if we encounter
a symbol that is already in the map, we error and exit.
This patch changes the error to only happen when a symbol we
care about (because we are either writing to it or reading
from it) occurs multiple times.
This lets us parse ELFs even when they have multiple symbols
with the same name and only error if it actually matters.
The current code would build up a map of ELF symbols when first parsing the ELF for quick lookup later on when we patch/read certain symbols. In this process if we encounter a symbol that is already in the map, we error and exit.
This patch changes the error to only happen when a symbol we care about (because we are either writing to it or reading from it) occurs multiple times.
This lets us parse ELFs even when they have multiple symbols with the same name and only error if it actually matters.
This issue was brought up by @nspin.