This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help about calculation of addend for ELF relocations for MIPS arch


> You need to show readelf -S foo.out so that we can see which section
> is index 5.
>
> It's rather odd that the VMA of the sections in foo.out are not zero.
> How did you produce foo.out?
>
> Ian
>

$mips-elf-readelf -S foo.out
There are 13 section headers, starting at offset 0x386c:

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        c0000000 000034 002190 00  AX  0   0  4
  [ 2] .rel.text         REL             00000000 003a74 0007f0 08     11   1  4
  [ 3] .data             PROGBITS        c0002190 0021c4 00105c 00  WA  0   0  4
  [ 4] .rel.data         REL             00000000 004264 000058 08     11   3  4
  [ 5] .bss              NOBITS          c00031ec 003220 000034 00  WA  0   0  4
  [ 6] .reginfo          MIPS_REGINFO    00000000 003220 000018 01      0   0  4
  [ 7] .pdr              PROGBITS        00000000 003238 0005e0 00      0   0  4
  [ 8] .rel.pdr          REL             00000000 0042bc 000178 08     11   7  4
  [ 9] .mdebug.abi32     PROGBITS        00000000 003818 000000 00      0   0  1
  [10] .shstrtab         STRTAB          00000000 003818 000054 00      0   0  1
  [11] .symtab           SYMTAB          00000000 004434 000ab0 10     12  62  4
  [12] .strtab           STRTAB          00000000 004ee4 000500 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

$cat foo.lds
OUTPUT_ARCH(mips)
ENTRY(Init)
SECTIONS
{
	.text 0xc0000000 :
	{ *(.text) *(.rodata*) }
	.data :  { *(.data) }
 	.bss  :  { *(.sbss) *(.scommon) *(.bss) *(COMMON) }
}

I invoke the following command to create foo.out
$mips-elf-ld -EL -n -r -T foo.lds -o foo.out $(OBJS)

PRC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]