--fieldoffsets

This option prints a list of assembly language EQU directives that equate C++ class or C structure field names to their offsets from the base of the class or structure. The input ELF file can be a relocatable object or an image.

Use --output to redirect the output to a file. Use the INCLUDE command from armasm to load the produced file and provide access to C++ classes and C structure members by name from assembly language.

This option outputs all structure information. To output a subset of the structures, use --select select_options.

If you do not require a file that can be input to armasm, use the --text -a options to format the display addresses in a more readable form. The -a option only outputs address information for structures and static data in images because the addresses are not known in a relocatable object.

Show/hideRestrictions

This option:

  • is not available if the source file does not have debug information

  • can be used only in text mode.

Show/hideExample

The following examples show how to use --fieldoffsets:

  • To produce an output listing to stdout that contains all the field offsets from all structures in the file inputfile.o, enter:

    fromelf --fieldoffsets inputfile.o
    
  • To produce an output file listing to outputfile.a that contains all the field offsets from structures in the file inputfile.o that have a name starting with p, enter:

    fromelf --fieldoffsets --select=p* --output=outputfile.a inputfile.o
    
  • To produce an output listing to outputfile.a that contains all the field offsets from structures in the file inputfile.o with names of tools or moretools, enter:

    fromelf --fieldoffsets --select=tools.*,moretools.* --output=outputfile.a inputfile.o
    
  • To produce an output file listing to outputfile.a that contains all the field offsets of structure fields whose name starts with number and are within structure field top in structure tools in the file inputfile.o, enter:

    fromelf --fieldoffsets --select=tools.top.number* --output=outputfile.a inputfile.o
    

Show/hideSee also

Concepts

Developing Software for ARM® Processors:

Reference
Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0477E
Non-ConfidentialID071611