RicardasSim

c2nasm error with gcc -03

Nov 9th, 2018
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. main.c.nasm:26: error: attempt to define a local label before any non-local labels
  2.  
  3. ----------
  4. C
  5. ----------
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9.  
  10. int main(){
  11.  
  12. char *pTest[] = {"Zeppelin"};
  13.  
  14. printf("%s\n", pTest[0]);
  15.  
  16. return 0;
  17. }
  18.  
  19. ----------------
  20. c2nasm
  21. gcc(7.3.0)
  22. gcc -m64 -O3
  23. ----------------
  24.  
  25. default rel
  26.  
  27. global main
  28.  
  29. extern puts
  30. extern _GLOBAL_OFFSET_TABLE_
  31.  
  32. SECTION .text
  33.  
  34. SECTION .data
  35.  
  36. SECTION .bss
  37.  
  38. SECTION .rodata.str1.1
  39.  
  40. .LC0: ;<---(26)
  41. db 5AH, 65H, 70H, 70H, 65H, 6CH, 69H, 6EH
  42. db 00H
  43.  
  44. SECTION .text.startup
  45.  
  46. main:
  47. lea rdi, [rel .LC0]
  48. sub rsp, 8
  49. call puts
  50. xor eax, eax
  51. add rsp, 8
  52. ret
  53.  
  54. ----------
  55. fix
  56. ----------
  57.  
  58. default rel
  59.  
  60. global main
  61.  
  62. extern puts
  63. extern _GLOBAL_OFFSET_TABLE_
  64.  
  65. SECTION .text
  66.  
  67. SECTION .data
  68.  
  69. SECTION .bss
  70.  
  71. SECTION .text.startup
  72.  
  73. main:
  74. lea rdi, [rel .LC0]
  75. sub rsp, 8
  76. call puts
  77. xor eax, eax
  78. add rsp, 8
  79. ret
  80.  
  81. SECTION .rodata.str1.1
  82.  
  83. .LC0:
  84. db 5AH, 65H, 70H, 70H, 65H, 6CH, 69H, 6EH
  85. db 00H
Advertisement
Add Comment
Please, Sign In to add comment