Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wjones@raspberrypi-ptrain ~/src/asm $ cat reloc2.s
- /* -- load01.s */
- /* -- Data section */
- .data
- /* Ensure variable is 4-byte aligned */
- .balign 4
- /* Define storage for myvar1 */
- myvar1:
- /* Contents of myvar1 is just 4 bytes containing value '3' */
- .word 3
- /* Ensure variable is 4-byte aligned */
- .balign 4
- /* Define storage for myvar2 */
- myvar2:
- /* Contents of myvar2 is just 4 bytes containing value '4' */
- .word 4
- /* -- Code section */
- .text
- /* Ensure code is 4 byte aligned */
- .balign 4
- .global main
- main:
- ldr r1, myvar1 /* r1 ← &myvar1 */
- ldr r2, myvar2 /* r2 ← &myvar2 */
- add r0, r1, r2 /* r0 ← r1 + r2 */
- bx lr
- wjones@raspberrypi-ptrain ~/src/asm $ as -o reloc2.o reloc2.s
- reloc2.s: Assembler messages:
- reloc2.s:27: Error: internal_relocation (type: OFFSET_IMM) not fixed up
- reloc2.s:28: Error: internal_relocation (type: OFFSET_IMM) not fixed up
- wjones@raspberrypi-ptrain ~/src/asm $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement