Complex location of address addresses

I looked at the destination addresses.

00010004 <arr>: 10004: 10080402 .word 0x10080402 10008: 20 .byte 0x20 
00010009 <eoa>: 10009: 00 .byte 0x00 ... 
0001000c <start>: ...

      

Building a piece of code:

.section .text.ResetISR
.align
.global ResetISR
.type ResetISR, %function

ResetISR:
   b start

arr:
  .byte 2, 4, 8, 16, 32

eoa:
  .align

start: ...

      


Why does the eoa address start with 00010009

. It should start with 0001000d

, right?
Why does memory access start from 0001000c

and not from 0001000d

?

+3


source to share


1 answer


A shim will be added to the eoa label using the .align

start directive .
This means that the eoa label itself just follows the 5 byte array that ended at 00010009h.

Then padding inserts 3 null bytes, putting a start mark of 3 more bytes in 0001000Ch.




It should start with "0001000d" right?

I think you think the directive is .align

inserting a fixed number of bytes into the code (00010005h + 8 = 0001000Dh).
However, it introduces an estimated number of padding bytes to have the following code at the aligned address.

+3


source







All Articles