<div>Hi,</div>
<div> </div>
<div>I'm new to U-Boot. Here I got some questions when I read the following code in include/ppc_asm.tmpl:</div>
<div> </div>
<div>
<p>#define START_GOT \<br> .section ".got2","aw"; \<br>.LCTOC1 = .+32768</p>
<p>#define END_GOT \<br> .text</p>
<p>#define GET_GOT \<br> bl 1f ; \<br> .text 2 ; \<br>0: .long .LCTOC1-1f ; \<br> .text ; \<br>1: mflr r14 ; \<br> lwz r0,0b-1b(r14) ; \<br> add r14,r0,r14 ;</p>
<p>#define GOT_ENTRY(NAME) .L_ ## NAME = . - .LCTOC1 ; .long NAME</p>
<p>#define GOT(NAME) .L_ ## NAME (r14)<br></p>
<p>1. As what I understand, after lwz r0,0b-1b(r14) , LOCTOC1-1f is stored in r0, but I totally lost with the following instruction:</p>
<p> add r14,r0,r14. What's in r14 now. Is the value of label "1f" the absolute address or relative address of the code it labels or whatever else?</p>
<p>2. What do the #define directives do here? I noticed there are spaces before and after "##"; what's the value of NAME in ".long NAME". In cup/mpc8xx/start.S, some code such as "lwz r7, GOT(_start)" invokes the macro.</p>
<p>Any idea will be truly appreciated.</p>
<p>David</p>
<p> </p>
<p> </p></div>