bug-gnu-utils
[Top][All Lists]
Advanced

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

gnu ld on sco5


From: Golubev I. N.
Subject: gnu ld on sco5
Date: Wed, 16 May 2001 18:51:06 (GMT)

Version: 2.11
Platform: i586-pc-sco3.2v5.0.2

`readelf -l' shows that executables generated by ld for elf_i386
target (which is sco5) lack PT_NOTE program header.  Since I did not
know how to change default PHDRS layout of ld, I made modified linker
script and passed it with `-T' option.  This generated an executable
that is runnable even on sco5 system with `OSRcompat' pkg installed.
That is, the executable is recognized as sco5 one, not unixware one,
by `/usr/lib/libc.so.1' program interpreter from `OSRcompat'.

This is how I had to modify it.  I need to learn a bit more to figure
out how to modify ld sources appropriately.  Or let binutils wizards
do such modification :-).

--- elf_i386.x  Fri May  4 11:54:41 2001
+++ sco5.x      Wed May 16 22:23:41 2001
@@ -5,12 +5,21 @@
 SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); 
SEARCH_DIR(/usr/i586-pc-sco3.2v5.0.2/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
+PHDRS
+{
+  headers PT_PHDR PHDRS ;
+  interp PT_INTERP ;
+  text PT_LOAD PHDRS ;
+  data PT_LOAD ;
+  dynamic PT_DYNAMIC ;
+  note PT_NOTE ;
+}
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
   . = 0x08048000 + SIZEOF_HEADERS;
-  .interp     : { *(.interp)   }
-  .hash          : { *(.hash)          }
+  .interp     : { *(.interp)   } :text :interp
+  .hash          : { *(.hash)          } :text
   .dynsym        : { *(.dynsym)                }
   .dynstr        : { *(.dynstr)                }
   .gnu.version   : { *(.gnu.version)   }
@@ -158,7 +167,7 @@
     *(.data.*)
     *(.gnu.linkonce.d.*)
     SORT(CONSTRUCTORS)
-  }
+  } :data
   .data1   : { *(.data1) }
   .eh_frame : { KEEP (*(.eh_frame)) }
   .gcc_except_table : { *(.gcc_except_table) }
@@ -190,7 +199,7 @@
     KEEP (*(.dtors))
   }
   .got           : { *(.got.plt) *(.got) }
-  .dynamic       : { *(.dynamic) }
+  .dynamic       : { *(.dynamic) } :data :dynamic
   /* We want the small data sections together, so single-instruction offsets
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */
@@ -199,7 +208,7 @@
     *(.sdata) 
     *(.sdata.*)
     *(.gnu.linkonce.s.*)
-  }
+  } :data
   _edata = .;
   PROVIDE (edata = .);
   __bss_start = .;
@@ -231,7 +240,8 @@
   _end = .;
   PROVIDE (end = .);
   /* Stabs debugging sections.  */
-  .stab 0 : { *(.stab) }
+  .note     : { *(.note)       } :note
+  .stab 0 : { *(.stab) } :NONE
   .stabstr 0 : { *(.stabstr) }
   .stab.excl 0 : { *(.stab.excl) }
   .stab.exclstr 0 : { *(.stab.exclstr) }



reply via email to

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