Page 1 of 1

Symbol map order...

Posted: Thu Sep 21, 2006 8:57 am
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

Re:Symbol map order...

Posted: Fri Sep 22, 2006 2:34 am
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 ...

Re:Symbol map order...

Posted: Fri Sep 22, 2006 9:37 am
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

Re:Symbol map order...

Posted: Mon Oct 02, 2006 1:16 am
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 ...