About macro expand

mr924352@cs.nthu.edu.tw mr924352@cs.nthu.edu.tw
Mon Mar 29 15:51:00 GMT 2004



Hello, all
  
I have a assembly program (as following).That use the "MAX" constant.
But,i does not define it in the program.
When i assemble this program, it can be assembled successfully.
That mean that it does not have any error message.
But, this program is wrong because the "MAX"  value is unkonw.
 
My question is how to modify the GNU assembler source code or maybe i just add 
some option before i assemble the program. Then, if the assember encounter 
this unknow value,it can stop assemble and show the
value unknow error message.
                                                                               
 thanks a lot
 
  .file   "hello.c"
    .section    .rodata
    .align  2
.LC0:
    .ascii  "This is a test value(%d)\n\000"
    .text
    .align  2
    .global main
    .type   main, %function
main:
    @ args = 0, pretend = 0, frame = 0
    @ frame_needed = 1, uses_anonymous_args = 0
    mov ip, sp
    stmfd   sp!, {fp, ip, lr, pc}
    sub fp, ip, #4
    ldr r0, .L2
    mov r1, #MAX
    bl  printf
    mov r3, #0
    mov r0, r3
    ldmfd   sp, {fp, sp, pc}
.L3:
    .align  2
.L2:
    .word   .LC0
    .size   main, .-main
    .ident  "GCC: (GNU) 3.4 20031119 (experimental)"
~



More information about the Binutils mailing list