[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

turn off section padding

From: Peter Ka
Subject: turn off section padding
Date: Sat, 28 Sep 2013 19:07:29 -0400 (EDT)


I'm working with a binutils cross compiled for MIPS. 

It sees that as likes to pad sections so that they're multiples of 32 bytes. If you look at the listings below, both .text and .bss setions get padded with extra bytes that are not present in the original source file.

Is there a way to avoid this? 

$ cat foo.s
.global _start


li $a0, 1
ori $v0, $a0, 2

.word 0x1234
.word 0x5678
.word 0x9abc
.word 0xdead

.space 4
$ ~/mips/mipsel-psx-ecoff-as -o foo.o foo.s 
$ ~/mips/mipsel-psx-ecoff-objdump  -D -s -z foo.o

foo.o:     file format ecoff-littlemips

Contents of section .text:
 0000 01000424 02008234 00000000 00000000  ...$...4........
Contents of section .data:
 0010 34120000 78560000 bc9a0000 adde0000  4...xV..........

Disassembly of section .text:

00000000 <_start>:
   0: 24040001 li a0,1
   4: 34820002 ori v0,a0,0x2
   8: 00000000 nop
   c: 00000000 nop

Disassembly of section .data:

00000010 <.data>:
  10: 00001234 0x1234
  14: 00005678 0x5678
  18: 00009abc 0x9abc
  1c: 0000dead 0xdead

Disassembly of section .bss:

00000020 <.bss>:
  20: 00000000 nop
  24: 00000000 nop
  28: 00000000 nop
  2c: 00000000 nop

reply via email to

[Prev in Thread] Current Thread [Next in Thread]