This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: Trivial patch for elf.sc in ld.


> Date: 28 Sep 1999 09:25:06 -0400
> From: Ian Lance Taylor <ian@zembu.com>
> CC: rth@cygnus.com, binutils@sourceware.cygnus.com
> 
>    Date: Tue, 28 Sep 1999 13:53:40 +1000
>    From: Geoff Keating <geoffk@ozemail.com.au>
> 
>    >    Wed Sep 22 12:42:36 1999  Geoffrey Keating  <geoffk@cygnus.com>
>    > 
>    > 	   * scripttempl/elf.sc (.sdata): Include .gnu.linkonce.s.* sections
>    > 	   in .sdata too.
> 
>    OK, I'll commit it.
> 
> Actually, I noticed a problem with your patch.  You include the
> .gnu.linkonce section unconditionally, not only when RELOCATING is
> set.  You need to fix that to correspond to other inclusions of
> .gnu.linkonce sections, as otherwise ld -r will fail.

There's a lot of that around.  How about this?  I haven't tested it.

-- 
Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/tx49-bin-sdata.patch===============
md5sum: 9e265fdcbf6c8a74 9503e2f1f2a00ab4 348354
Index: binutils/ld/ChangeLog
0a
1999-09-29  Geoffrey Keating  <geoffk@cygnus.com>

	* scripttempl/elf.sc (.rel.sdata): Combine all the sdata relocs.
	(.rela.sdata): Likewise.
	(.rel.sbss): Likewise.
	(.rela.sbss): Likewise.
	(.sdata): Don't include .gnu.linkonce.s.* or .sdata.* when
	ld -r.
	(.sbss): Do the same things as for .bss.

.
Changed files:
binutils/ld/ChangeLog
binutils/ld/scripttempl/elf.sc
md5sum: c5d23ef89c14ef71 ef7de1eda2241cdc 10806
--- /sloth/disk0/co/binutils-mainline/binutils/ld/scripttempl/elf.sc	Tue Sep 28 14:06:12 1999
+++ binutils/ld/scripttempl/elf.sc	Wed Sep 29 13:39:59 1999
@@ -169,6 +169,20 @@ cat <<EOF
   .rel.got     ${RELOCATING-0} : { *(.rel.got)		}
   .rela.got    ${RELOCATING-0} : { *(.rela.got)		}
   ${OTHER_GOT_RELOC_SECTIONS}
+  .rel.sdata   ${RELOCATING-0} :
+    {
+      *(.rel.sdata)
+      ${RELOCATING+*(.rel.sdata.*)}
+      ${RELOCATING+*(.rel.gnu.linkonce.s*)}
+    }
+  .rela.sdata   ${RELOCATING-0} :
+    {
+      *(.rela.sdata)
+      ${RELOCATING+*(.rela.sdata.*)}
+      ${RELOCATING+*(.rela.gnu.linkonce.s*)}
+    }
+  .rel.sbss    ${RELOCATING-0} : { *(.rel.sbss)		}
+  .rela.sbss   ${RELOCATING-0} : { *(.rela.sbss)	}
   .rel.bss     ${RELOCATING-0} : { *(.rel.bss)		}
   .rela.bss    ${RELOCATING-0} : { *(.rela.bss)		}
   .rel.plt     ${RELOCATING-0} : { *(.rel.plt)		}
@@ -232,7 +246,13 @@ cat <<EOF
   /* 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.  */
-  .sdata   ${RELOCATING-0} : { *(.sdata) *(.sdata.*) *(.gnu.linkonce.s.*) }
+  .sdata   ${RELOCATING-0} : 
+  {
+    ${RELOCATING+${SDATA_START_SYMBOLS}}
+    *(.sdata) 
+    ${RELOCATING+*(.sdata.*)}
+    ${RELOCATING+*(.gnu.linkonce.s.*)}
+  }
   ${RELOCATING+${OTHER_GOT_SECTIONS}}
   ${RELOCATING+_edata = .;}
   ${RELOCATING+PROVIDE (edata = .);}
@@ -240,8 +260,10 @@ cat <<EOF
   ${RELOCATING+${OTHER_BSS_SYMBOLS}}
   .sbss    ${RELOCATING-0} :
   {
-   *(.sbss) *(.scommon)
-   ${RELOCATING+*(.sbss.*)}
+    *(.dynsbss)
+    *(.sbss)
+    ${RELOCATING+*(.sbss.*)}
+    *(.scommon)
   }
   .bss     ${RELOCATING-0} :
   {
============================================================

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