Symbol map order...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
João Jerónimo

Symbol map order...

Post by João Jerónimo »

When I ask a symbol map to the linker, it always gives me the labels out of any specific order... why?

Ah! right! It may be the order the assembler filled in the hash table entries, right?


Anyway, how can I make ld order the symbols by ascending relocation address order?

JJ
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Symbol map order...

Post by Pype.Clicker »

by relocation order ?? you mean sorted by address?

just tried with sort, but that didn't work well ... that sounds like a job for a perl script ...
João Jerónimo

Re:Symbol map order...

Post by João Jerónimo »

Pype.Clicker wrote: by relocation order ?? you mean sorted by address?
Yes... by relocation address order!
I'm using diferent load addresses than relocation addresses (the address that the linker links the sections at) so I made the difference...
just tried with sort, but that didn't work well ... that sounds like a job for a perl script ...
I'm a bit poor on the number of programming languages I know... I only know x86 assembly, C, make and CASIO BASIC (not considering a bit of bash nor markup languages)...

I know I need to correct it, but for now I've frequented no programming courses so I don't want to learn thing just to say that i know them!
But seems a text manipulation language would be useful enough... perl is of this sort, isn't it? Or is it sed?

JJ
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Symbol map order...

Post by Pype.Clicker »

Jo?o Jer?nimo wrote: But seems a text manipulation language would be useful enough... perl is of this sort, isn't it? Or is it sed?
SED is a sort of on-the-fly-text-editor ... that is, you can stream some text in and require that every occurence of "Hello World" becomes "Salutations" ... Perl is somehow a mix between C and BASIC syntax with that, among other things, has native operators to do the above ... and afaik, it also has a list-sorting operation.

Alternatively, you could do the script operation in pure C, but that would just turn out to be a boring-to-recompile, error-prone implementation compared to a PERL script for the same job ...
Post Reply