Advertisement
Guest User

/linuxrc and its Makefile

a guest
Jan 18th, 2021
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. server ~/ateb9200/example # cat ./linuxrc.c
  2.  
  3. int main(int arc, char **argv)
  4. {
  5. while (1);
  6. return 0;
  7. }
  8.  
  9. server ~/ateb9200/example # cat ./stubstart.S
  10. .globl _start
  11.  
  12. _start:
  13. BL main
  14.  
  15.  
  16. server ~/ateb9200/example # cat ./Makefile
  17. CC=arm-softfloat-linux-gnueabi-gcc
  18. CFLAGS= -static -nostdlib -O2 -Wall -pedantic -std=c89
  19.  
  20. linuxrc: linuxrc.o
  21. $(CC) $(CFLAGS) stubstart.S -o linuxrc linuxrc.o
  22. arm-softfloat-linux-gnueabi-strip --strip-unneeded linuxrc
  23. linuxrc.o: linuxrc.c
  24. $(CC) $(CFLAGS) -c linuxrc.c
  25. clean:
  26. rm -f *.o *~ linuxrc
  27.  
  28.  
  29. server ~/ateb9200/example # make
  30. arm-softfloat-linux-gnueabi-gcc -static -nostdlib -O2 -Wall -pedantic -std=c89 -c linuxrc.c
  31. arm-softfloat-linux-gnueabi-gcc -static -nostdlib -O2 -Wall -pedantic -std=c89 stubstart.S -o linuxrc linuxrc.o
  32. arm-softfloat-linux-gnueabi-strip --strip-unneeded linuxrc
  33.  
  34.  
  35. server ~/ateb9200/example # ls -la ./linuxrc
  36. -rwxrwxrwx 1 root root 440 Jan 18 22:04 ./linuxrc
  37.  
  38.  
  39. server ~/ateb9200/example # readelf -h ./linuxrc
  40. ELF Header:
  41. Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  42. Class: ELF32
  43. Data: 2's complement, little endian
  44. Version: 1 (current)
  45. OS/ABI: UNIX - System V
  46. ABI Version: 0
  47. Type: EXEC (Executable file)
  48. Machine: ARM
  49. Version: 0x1
  50. Entry point address: 0x10078
  51. Start of program headers: 52 (bytes into file)
  52. Start of section headers: 240 (bytes into file)
  53. Flags: 0x5000200, Version5 EABI, soft-float ABI
  54. Size of this header: 52 (bytes)
  55. Size of program headers: 32 (bytes)
  56. Number of program headers: 2
  57. Size of section headers: 40 (bytes)
  58. Number of section headers: 5
  59. Section header string table index: 4
  60.  
  61.  
  62. server ~/ateb9200/example # readelf -A ./linuxrc
  63. Attribute Section: aeabi
  64. File Attributes
  65. Tag_CPU_name: "5T"
  66. Tag_CPU_arch: v5T
  67. Tag_ARM_ISA_use: Yes
  68. Tag_THUMB_ISA_use: Thumb-1
  69. Tag_ABI_PCS_wchar_t: 4
  70. Tag_ABI_FP_denormal: Needed
  71. Tag_ABI_FP_exceptions: Needed
  72. Tag_ABI_FP_number_model: IEEE 754
  73. Tag_ABI_align_needed: 8-byte
  74. Tag_ABI_enum_size: int
  75.  
  76. server /usr/arm-softfloat-linux-gnueabi/lib # readelf -h ./libc-2.32.so
  77. ELF Header:
  78. Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  79. Class: ELF32
  80. Data: 2's complement, little endian
  81. Version: 1 (current)
  82. OS/ABI: UNIX - System V
  83. ABI Version: 0
  84. Type: DYN (Shared object file)
  85. Machine: ARM
  86. Version: 0x1
  87. Entry point address: 0x17e10
  88. Start of program headers: 52 (bytes into file)
  89. Start of section headers: 1648456 (bytes into file)
  90. Flags: 0x5000200, Version5 EABI, soft-float ABI
  91. Size of this header: 52 (bytes)
  92. Size of program headers: 32 (bytes)
  93. Number of program headers: 10
  94. Size of section headers: 40 (bytes)
  95. Number of section headers: 67
  96. Section header string table index: 66
  97.  
  98.  
  99. server /usr/arm-softfloat-linux-gnueabi/lib # readelf -A ./libc-2.32.so
  100. Attribute Section: aeabi
  101. File Attributes
  102. Tag_CPU_name: "ARM10TDMI"
  103. Tag_CPU_arch: v5T
  104. Tag_ARM_ISA_use: Yes
  105. Tag_THUMB_ISA_use: Thumb-1
  106. Tag_ABI_PCS_wchar_t: 4
  107. Tag_ABI_FP_rounding: Needed
  108. Tag_ABI_FP_denormal: Needed
  109. Tag_ABI_FP_exceptions: Needed
  110. Tag_ABI_FP_user_exceptions: Needed
  111. Tag_ABI_FP_number_model: IEEE 754
  112. Tag_ABI_align_needed: 8-byte
  113. Tag_ABI_align_preserved: 8-byte, except leaf SP
  114. Tag_ABI_enum_size: int
  115. Tag_ABI_optimization_goals: Aggressive Speed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement