armcc assembler

Hi

in assembler file I have

// RO_BASE = 0x78000000

funcName 

   DCD FooEntry  - . + .

what does it mean "minus dot plus dot"?

  • Hello WizIO,

    The 'dot' means the address of the instruction or data. it is most commonly used as a "B ." branch to self instruction in (dummy) exception handlers.

    Therefore I _believe_ the above line means to create a data value evaluating to "FooEntry minus current address plus current address"... = FooEntry :)

    I'm not entirely sure why one would do this, perhaps to obfuscate the FooEntry symbol?

  • Hi Ronan
    Thanks for answer
    I found this in Qalcomm ThreadX module
    This create header of the BIN from ELF for relocations

    and the question "...why one would do this..."
    I compile:

    foo // = 0x78000000 is ro_base (-ro)
    DCB 0,0,0,0,0,0,0 // 7 zeroes
    DCB foo // = 0x78000007
    DCB foo - . + . // = 0x00000008
    DCB foo // = 0x78000009

    "- . + ." it seems as current address minus ro_base