[Bug ld/3777] New: ld -q , (Host PC/OS: Free-BSD, Target Machine: powerpc)

2006-12-21 Thread rewex at hanmail dot net
I want to make an ELF(ld -q flag, powerpc). 
I want to find that why generates "Segmentation fault(core dumped)" on
relocations section. 

===
: GNU ld version 2.15
: GNU C version 3.4.1 060908 (powerpc-unknown-tkernel)
: compiled by GNU C version 2.95.3 20010315 (release) [FreeBSD].
: linker option: -q ( --emit relocations )
===

---
: Makefile`s ld option is  "-static -q -Wl,-q,-v" 

pcsv3-160$gmake
Makefile:102: Dependencies: No such file or directory
touch Dependencies
/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel/bin/gccppc   -mcpu=405
-msoft-float -I/u9/te/include/unix -I/u9/te/include -D_PPC405_ -DBKERNEL
-DUSE_UNICODE -DUSE_HKANA -DUSE_JIS -c ../src.kim/test.S -o test.o
/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel/bin/gccppc  -L/u9/te/lib/ppc405
-mcpu=405 -msoft-float -static -q -Wl,-q,-v -T reloc.lnk  -nostdlib test.o -o 
test
collect2 version 3.4.1 060908 (PowerPC T-Kernel)
/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel/bin/ld -Qy -static -static -o
test -L/u9/te/lib/ppc405 -L/u9/te/lib/ppc405
-L/u9/te/tool/FreeBSD-i386/libexec/gcc/powerpc-unknown-tkernel/3.4.1
-L/u9/te/tool/FreeBSD-i386/libexec/gcc
-L/u9/te/tool/FreeBSD-i386/lib/gcc/powerpc-unknown-tkernel/3.4.1/nof
-L/u9/te/tool/FreeBSD-i386/lib/gcc/powerpc-unknown-tkernel/3.4.1
-L/u9/te/tool/FreeBSD-i386/lib/gcc
-L/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel/bin
-L/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel
-L/u9/te/tool/FreeBSD-i386/lib/gcc/powerpc-unknown-tkernel/3.4.1/nof
-L/u9/te/tool/FreeBSD-i386/lib/gcc/powerpc-unknown-tkernel/3.4.1
-L/u9/te/tool/FreeBSD-i386/lib/gcc/powerpc-unknown-tkernel/3.4.1/../../../../powerpc-unknown-tkernel/lib
-q -v test.o -T reloc.lnk
/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel/bin/ld: warning: cannot find
entry symbol _start; defaulting to 2000
GNU ld version 2.15
#/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel/bin/gccppc 
-L/u9/te/lib/ppc405 -mcpu=405 -msoft-float -static -q -Wl,-q,-v -T reloc.lnk  
test.o  -lg -ltk -lg -lsvc -o test
/u9/te/tool/FreeBSD-i386/powerpc-unknown-tkernel/bin/nm -C -n test |
/u9/te/etc/chkundef -powerpc > test.map


---
pcsv3-160$cat test.S

.text
_start:
stwu 1, -48(1)
stw 31,44(1)
mr  31,1
stw 3,8(31)
stw 4,12(31)
li  0,0
stw 0,16(31)
lis 9,[EMAIL PROTECTED]
li  0,1
stw 0,[EMAIL PROTECTED](9)

.comm g,4,4

---
pcsv3-160$readelf -a test  

this is a part of readelf file.

Relocation section '.rela.text' at offset 0x2000 contains 2 entries:
  OffsetInfo  TypeSymbol's Value  Symbol's Name  Addend
  002e7379  6d746162 unrecognised: 62  bad symbol index: 006d7461
  72746162  2e7368 R_PPC_EMB_NADDR16_HI  bad symbol index: 2e73


I found that ".rela.xxx" area is overlapping.

-- 
   Summary: ld -q , (Host PC/OS: Free-BSD, Target Machine: powerpc)
   Product: binutils
   Version: 2.15
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: rewex at hanmail dot net
CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=3777

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/3777] ld -q , (Host PC/OS: Free-BSD, Target Machine: powerpc)

2006-12-21 Thread rewex at hanmail dot net

--- Additional Comments From rewex at hanmail dot net  2006-12-21 08:13 
---
I`m reporter. Sorry, I can`t report well 

This is ELF file ( readelf -r test )
---
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
  Class: ELF32
  Data:  2's complement, big endian
  Version:   1 (current)
  OS/ABI:UNIX - System V
  ABI Version:   0
  Type:  EXEC (Executable file)
  Machine:   PowerPC
  Version:   0x1
  Entry point address:   0x2000
  Start of program headers:  52 (bytes into file)
  Start of section headers:  8256 (bytes into file)
  Flags: 0x0
  Size of this header:   52 (bytes)
  Size of program headers:   32 (bytes)
  Number of program headers: 2
  Size of section headers:   40 (bytes)
  Number of section headers: 10
  Section header string table index: 7
 
Section Headers:
  [Nr] Name  TypeAddr OffSize   ES Flg Lk Inf Al
  [ 0]   NULL 00 00 00  0   0  0
  [ 1] .text PROGBITS2000 001000 30 00  AX  0   0  4
  [ 2] .rela.textRELA 002000 18 0c  8   1  4
  [ 3] .data PROGBITS20001000 002000 00 00  WA  0   0  1
  [ 4] .sdataPROGBITS20001000 002000 00 00  WA  0   0  4
  [ 5] .sbss NOBITS  20001000 002000 04 00  WA  0   0  4
  [ 6] .bss  NOBITS  20001004 002000 00 00  WA  0   0  1
  [ 7] .shstrtab STRTAB   002000 3e 00  0   0  1
  [ 8] .symtab   SYMTAB   0021d0 000180 10  9  11  4
  [ 9] .strtab   STRTAB   002350 b5 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)
 
Program Headers:
  Type   Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD   0x001000 0x2000 0x2000 0x00030 0x00030 R E 0x1000
  LOAD   0x002000 0x20001000 0x20001000 0x0 0x4 RW  0x1000

 Section to Segment mapping:
  Segment Sections...
   00 .text
   01 .sbss
   
   
There is no dynamic segment in this file.
   
   
Relocation section '.rela.text' at offset 0x2000 contains 2 entries:
  OffsetInfo  TypeSymbol's Value  Symbol's Name  Addend
  002e7379  6d746162 unrecognised: 62  bad symbol index: 006d7461
  72746162  2e7368 R_PPC_EMB_NADDR16_HI  bad symbol index: 2e73
   
   
There are no unwind sections in this file.
   
   
Symbol table '.symtab' contains 24 entries:
   Num:Value  Size TypeBind   Vis  Ndx Name
 0:  0 NOTYPE  LOCAL  DEFAULT  UND
 1: 2000 0 SECTION LOCAL  DEFAULT1
 2:  0 SECTION LOCAL  DEFAULT2
 3: 20001000 0 SECTION LOCAL  DEFAULT3
 4: 20001000 0 SECTION LOCAL  DEFAULT4
 5: 20001000 0 SECTION LOCAL  DEFAULT5
 6: 20001004 0 SECTION LOCAL  DEFAULT6
 7:  0 SECTION LOCAL  DEFAULT7
 8:  0 SECTION LOCAL  DEFAULT8
 9:  0 SECTION LOCAL  DEFAULT9
10:  0 FILELOCAL  DEFAULT  ABS /u9/te/include/tk/ppc/asm.h
11:  0 FILELOCAL  DEFAULT  ABS 
/u9/te/include/tk/ppc/ppcdefs.h
12:  0 FILELOCAL  DEFAULT  ABS /u9/te/include/tk/ppc/asm.h
13:  0 FILELOCAL  DEFAULT  ABS /u9/te/include/machine.h
14:  0 FILELOCAL  DEFAULT  ABS 
15:  0 FILELOCAL  DEFAULT  ABS 
16: 2000 0 NOTYPE  LOCAL  DEFAULT1 _start
17: 20001000 4 OBJECT  GLOBAL DEFAULT5 g
18: 20009000 0 OBJECT  GLOBAL DEFAULT4 _SDA_BASE_
19: 20001000 0 NOTYPE  GLOBAL DEFAULT5 __bss_start
20: 20001000 0 NOTYPE  GLOBAL DEFAULT4 _edata
21: 20001004 0 NOTYPE  GLOBAL DEFAULT6 _end
22: 20001000 0 N

[Bug ld/3777] ld -q , (Host PC/OS: Free-BSD, Target Machine: powerpc)

2006-12-21 Thread rewex at hanmail dot net

--- Additional Comments From rewex at hanmail dot net  2006-12-21 08:21 
---
This is "objdump -x test" :
---
pcsv3-175$objdump -x test > objdump_x_file

BFD: test(.text): relocation 0 has invalid symbol index 7173217
BFD: test(.text): relocation 1 has invalid symbol index 11891
Segmentation fault (core dumped)


? Question ?
 Why occur [invalid symbol index] and [Segmentation fault] ?


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=3777

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils