Code: Select all
.globl start_code
start_code:
b .
Code: Select all
ENTRY(start_code)
SECTIONS
{
.text :
{
*(.text)
}
}
Code: Select all
arm-none-linux-gnueabi-gcc -c test.S
arm-none-linux-gnueabi-ld -T ldscript test.o -o test
Code: Select all
arm-none-linux-gnueabi-readelf -a test
Code: Select all
....
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS 00000000 008000 000004 00 AX 0 0 1
[ 2] .ARM.attributes ARM_ATTRIBUTES 00000000 008004 000014 00 0 0 1
[ 3] .shstrtab STRTAB 00000000 008018 000031 00 0 0 1
[ 4] .symtab SYMTAB 00000000 00813c 000050 10 5 4 4
[ 5] .strtab STRTAB 00000000 00818c 00000f 00 0 0 1
.....
Code: Select all
hexdump -C test
Code: Select all
00000000 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
00000010 02 00 28 00 01 00 00 00 00 00 00 00 34 00 00 00 |..(.........4...|
00000020 4c 80 00 00 00 00 00 05 34 00 20 00 01 00 28 00 |L.......4. ...(.|
00000030 06 00 03 00 01 00 00 00 00 80 00 00 00 00 00 00 |................|
00000040 00 00 00 00 04 00 00 00 04 00 00 00 05 00 00 00 |................|
00000050 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00008000 fe ff ff ea 41 13 00 00 00 61 65 61 62 69 00 01 |....A....aeabi..|
00008010 09 00 00 00 06 01 08 01 00 2e 73 79 6d 74 61 62 |..........symtab|
00008020 00 2e 73 74 72 74 61 62 00 2e 73 68 73 74 72 74 |..strtab..shstrt|
00008030 61 62 00 2e 74 65 78 74 00 2e 41 52 4d 2e 61 74 |ab..text..ARM.at|
00008040 74 72 69 62 75 74 65 73 00 00 00 00 00 00 00 00 |tributes........|
00008050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
......
NOTE:
Using ALIGN(x) and SUBALIGN(y) in the '.text' section didn't change it at all.
Thanks in advance.