This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A instrustion question about ARM


>>>>> "Martin" == Martin Bian <martin@utstar.com> writes:
Martin> I use a ARM v7t chip and write assemble code under arm-elf-gcc.
Martin> I used a instruction like this:
Martin>     .data 
Martin> label1:   .word       0x00
Martin> ..

Martin>     .text
Martin> ..
Martin>     ldr r0,label1

Martin> when I compiled the source codes, a error was printed out: Error:=
Martin>  Internal_relocation (type 197) not fixed up (OFFSET_IMM)

Martin> Then, I made a little change, I declared the label1 in .text=
Martin>  section.
Martin>     .text
Martin> label1:    .word      0x00
Martin> ..
Martin>     ldr r0,label1
            ^^^^^^^^^^^^^
That's a PC-relative load, ``label1'' must be in the same section as
the insn.

~velco


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]