http://www.osdev.org/phpBB2/viewtopic.p ... linker+map
Well, I've written a very simple Python script that does the job and also removes all the unneeded garbage... at least for me...
If you want it:
Code: Select all
file = open("kernel.map")
filelines = file.readlines()
file.close()
unneeded_excluded = []
for a in filelines:
if a.lstrip().startswith("0x"):
unneeded_excluded.append(a.strip())
splited = []
for a in unneeded_excluded:
splited.append(a.split(None, 1))
addresses = []
for a in splited:
addresses.append(a[0])
addresses.sort()
linesdict = {}
for a in splited:
linesdict[a[0]] = a[1]
for a in addresses:
print "%s\t%s\n" % (a, linesdict[a]),
It assumes the map is called "kernel.map" in the current directory and outputs to stdout... it also assumes that the addresses are in hexadecial, which I don't know if LD allows to change... adapt it to your needs...
It's not very genial, but I thought could be useful... took me only some minutes...
JJ