Passing Annotations/Labels to Symbol Table
Ian Lance Taylor
ian@airs.com
Thu Jan 13 01:39:00 GMT 2005
VJ <Vijay.Janapareddi@colorado.edu> writes:
> I need to modify gcc so as to add customized Labels for instructions in an ELF
> binary after it is done optimizing the code and to then make it output a symbol
> for the labeled instruction so that I can view the label in the symbol table.
>
> For example, I need to label every load instruction in a function with a unique
> ID and to make that ID show up as a symbol in the symbol table along with the
> memory address of the load instruction corresponding to the ID.
Edit the .md file and .c file for your target to add a label for each
instruction.
Or it would probably be simpler to write a little post-processor which
transformed the .s file and added labels. Then run gcc with -S, run
your post-processor, and then run gcc with -c on the output.
Ian
More information about the Gcc-help
mailing list