unsure about asm-offsets.c compilation in U-boot source

442 Views Asked by At

I could see lib/asm-offset.c file in u-boot(2014.07) source(another file at arch/arm/lib/asm-offsets.c), main function is defined in these files. Initially I got doubht who will call this main function, I checked Makefile, but no entry for this file in Makefile also. After build there is no object file for this. I could see only asm-offsets.s and asm-offsets.su files after build. asm-offsets.s is around 1000 lines and asm-offsets.su is having only one line - asm-offsets.c:19:5:main 0 static. From the asm-offsets.c source, it seems it is declaring some variables. Can you please help to understand how this source is embedded in U-boot bin

1

There are 1 best solutions below

0
user3693586 On

lib/asm-offsets.c file is used to generate header file with definitions for global data size, board info size etc..., These definitions will be used in assembly files.

We can see following lines while building u-boot.

  CC      lib/asm-offsets.s
  GEN     include/generated/generic-asm-offsets.h

similarly for arch/arm/lib/asm-offsets.c

CC      arch/arm/lib/asm-offsets.s
GEN     include/generated/asm-offsets.h