You copied the Doc URL to your clipboard.


Prints data addresses, including arrays that are expanded both inside and outside structures.


You can use this option with --text -a or with --fieldoffsets.


The following example shows the output for a struct containing arrays when --fieldoffsets --expandarrays is specified:

// foo.c
struct S {
    char A[8];
    char B[4];
struct S s;

struct S* get()
    return &s;
> armclang -target arm-arm-none-eabi -march=armv8-a -g -c foo.c
> fromelf --fieldoffsets --expandarrays foo.o
; Structure, S , Size 0xc bytes, from foo.c
|S.A|                                    EQU    0        ;  array[8] of char
|S.A[0]|                                 EQU    0        ;  char
|S.A[1]|                                 EQU    0x1      ;  char
|S.A[2]|                                 EQU    0x2      ;  char
|S.A[3]|                                 EQU    0x3      ;  char
|S.A[4]|                                 EQU    0x4      ;  char
|S.A[5]|                                 EQU    0x5      ;  char
|S.A[6]|                                 EQU    0x6      ;  char
|S.A[7]|                                 EQU    0x7      ;  char
|S.B|                                    EQU    0x8      ;  array[4] of char
|S.B[0]|                                 EQU    0x8      ;  char
|S.B[1]|                                 EQU    0x9      ;  char
|S.B[2]|                                 EQU    0xa      ;  char
|S.B[3]|                                 EQU    0xb      ;  char
; End of Structure S