Porting issues [please advice]

Balint Cristian rezso@rdsor.ro
Fri Aug 12 08:25:00 GMT 2005


Hello !

   I try to respin up openrisc alias "or32" target wich is dead since 2001
i will need a little advice for a novice in binutils.

1) or32 is ancient since 2.11 nobody taked care, is an opensorce designed
CPU core.
2) i put efforts and ported during 2.11->2.12->2.13->2.14 and 2.14 is last
version i done and its OK, just by copying files from 2.11 and looking how
to align the code to version changes during the time.
3) During 2.14 -> 2.16.1 i have bigger problems, the or32elf.sh from
emultempl is no more valid so my first idea isto drop it,and to use
TEMPLATE_NAME=elf32 wich is the default template, assuming the fact that
even the ancient or32elf.sh template was as I see a plain default template
without any kind of before/post linkink stuff in it but an ancianter one
wich 2.16.1 refuses becaus of very old incompatible code in it.

       Everything work in 2.16.1 except ld for or32 target cpu, even
linkink together more .o kernel file is OK but in some cases
linking is not OK see example of objdump -x at bottom of the mail
maibe can tell whats happaning or give advices where to look.

 Q arises:

           1) Where can i found  good ELF layout docs to understand things
what binutils done.
            2) Is somewhere a good porting guide for binutils ?
            3) how can i analyse whats happen during linking ? Or can I
analyse the validity or
        elf compliance of a elf file ?


Here is the diff showing beetwen the 2.14 and 2.16 linker strangeness,
maybe someone with experience can comment a bit why ld is borked for me in
2.16:
--- 2.14.sym    2005-08-12 10:28:22.000000000 +0300
+++ 2.16.sym    2005-08-12 10:28:28.000000000 +0300
@@ -1,6 +1,6 @@

-mtdlink-2.14.o:     file format elf32-or32
-mtdlink-2.14.o
+mtdlink-2.16.o:     file format elf32-or32
+mtdlink-2.16.o
 architecture: or32, flags 0x00000011:
 HAS_RELOC, HAS_SYMS
 start address 0x00000000
@@ -9,16 +9,16 @@
 Idx Name          Size      VMA       LMA       File off  Algn
   0 .text         000079e4  00000000  00000000  00000034  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
-  1 __ksymtab     00000058  00000000  00000000  00007a18  2**2
+  1 .text.init    000000a8  00000000  00000000  00007a18  2**2
+                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
+  2 .text.exit    00000088  00000000  00000000  00007ac0  2**2
+                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
+  3 __ksymtab     00000058  00000000  00000000  00007b48  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
-  2 .kstrtab      000000cd  00000000  00000000  00007a70  2**0
+  4 .kstrtab      000000cd  00000000  00000000  00007ba0  2**0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  3 .rodata.str1.1 0000078f  00000000  00000000  00007b3d  2**0
+  5 .rodata.str1.1 0000078f  00000000  00000000  00007c6d  2**0
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  4 .text.init    000000a8  00000000  00000000  000082cc  2**2
-                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
-  5 .text.exit    00000088  00000000  00000000  00008374  2**2
-                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   6 .data         00000060  00000000  00000000  000083fc  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, DATA
   7 .exitcall.exit 0000000c  00000000  00000000  0000845c  2**2
@@ -606,32 +606,6 @@
 0000799c R_OR32_JUMPTARG   ___up


-RELOCATION RECORDS FOR [__ksymtab]:
-OFFSET   TYPE              VALUE
-00000000 R_OR32_32         .text
-00000004 R_OR32_32         .kstrtab
-00000008 R_OR32_32         .text
-0000000c R_OR32_32         .kstrtab
-00000010 R_OR32_32         .text
-00000014 R_OR32_32         .kstrtab
-00000018 R_OR32_32         .text
-0000001c R_OR32_32         .kstrtab
-00000020 R_OR32_32         .text
-00000024 R_OR32_32         .kstrtab
-00000028 R_OR32_32         .text
-0000002c R_OR32_32         .kstrtab
-00000030 R_OR32_32         .text
-00000034 R_OR32_32         .kstrtab
-00000038 R_OR32_32         .text
-0000003c R_OR32_32         .kstrtab
-00000040 R_OR32_32         .text
-00000044 R_OR32_32         .kstrtab
-00000048 R_OR32_32         .text
-0000004c R_OR32_32         .kstrtab
-00000050 R_OR32_32         .text
-00000054 R_OR32_32         .kstrtab
-
-
 RELOCATION RECORDS FOR [.text.init]:
 OFFSET   TYPE              VALUE
 00000008 R_OR32_CONSTH     .data
@@ -666,6 +640,32 @@
 00000074 R_OR32_JUMPTARG   _remove_proc_entry


+RELOCATION RECORDS FOR [__ksymtab]:
+OFFSET   TYPE              VALUE
+00000000 R_OR32_32         .text
+00000004 R_OR32_32         .kstrtab
+00000008 R_OR32_32         .text
+0000000c R_OR32_32         .kstrtab
+00000010 R_OR32_32         .text
+00000014 R_OR32_32         .kstrtab
+00000018 R_OR32_32         .text
+0000001c R_OR32_32         .kstrtab
+00000020 R_OR32_32         .text
+00000024 R_OR32_32         .kstrtab
+00000028 R_OR32_32         .text
+0000002c R_OR32_32         .kstrtab
+00000030 R_OR32_32         .text
+00000034 R_OR32_32         .kstrtab
+00000038 R_OR32_32         .text
+0000003c R_OR32_32         .kstrtab
+00000040 R_OR32_32         .text
+00000044 R_OR32_32         .kstrtab
+00000048 R_OR32_32         .text
+0000004c R_OR32_32         .kstrtab
+00000050 R_OR32_32         .text
+00000054 R_OR32_32         .kstrtab
+
+
 RELOCATION RECORDS FOR [.data]:
 OFFSET   TYPE              VALUE
 00000000 R_OR32_32         .data


Thanks a lot !
~cristian









More information about the Binutils mailing list