microcontroller - ELF Relocation Types on MSP430 -
i have take relocatable elf file , fix addresses in msp430-f5529 red hat compiler (not ti). however, don't understand how relocations have made don't notation used.
here types , details.
let's take 1 example.
- name : r_msp430x_abs20_adr_dst
- signedness : unsigned
- containersize : 32
- field : [0,4]+[16,16]
and following generated asm :
0c60 0000 : mova r12, &0x00000
if search mova
opcode in wikipedia see structure of opcode follows:
offset : [7] [6] [5] [4] [3] [2] [1] [0]
hex value : [0] [dst] [6] [src] [src] [src] [src] [src]
we know dst c stands r12 , last 20 bits address replaced (last 4 bits plus 16 bits - last 4 0s-).
i know need understand how interpret [0,4]+[16,16]
. looks [0,4]
references last 4 bits on first 2 bytes (0060 0000), how work ? , how should read [16,16]
?
here quote of explanation on pdf in case understands.
the field specified using tuple [cs, o, fs], cs container size, o starting offset lsb of container lsb of field, , fs size of field. values in bits. notation [x,y]+[z,w] indicates relocation occupies discontiguous bit ranges, should concatenated form field.
thanks.
your "offset" values wrong.
"containersize: 32" means have view instruction single, little-endian, 32-bit value. 32-bit value, written 00000c60
. 4 bytes are, in order, 60
, 0c
, 00
, , 00
. bits follows:
31302928272625242322212019181716151413121110 9 8 7 6 5 4 3 2 1 0 a a a a a a a a 0 0 0 0 s s s s 0 1 1 0 a a
Comments
Post a Comment