This is the mail archive of the binutils@sources.redhat.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]

PPC linker fatal signal



$ cat > xx.s
	.data
	.global var
var:
	.long 0

	.text
	.global foo
foo:
	lwz	%r3, var@sdai16(%r13)
$ powerpc-svr4-gcc -c xx.s
$ powerpc-svr4-ld -o xx -entry=foo xx.o
Segmentation fault
$ 

2001-02-18  Momchil Velikov  <velco@fadata.bg>

	* elf32-ppc.c (ppc_elf_create_linker_section): Create the linker
	sections with `SEC_LINKER_CREATED' flag set, so their contents
	is allocated in `ppc_elf_size_dynamic_sections'. 

--- elf32-ppc.c.orig.1	Sun Feb 18 13:45:02 2001
+++ elf32-ppc.c	Sun Feb 18 19:22:28 2001
@@ -1558,16 +1558,17 @@
       defaults.hole_written_p = false;
       defaults.alignment = 2;
 
-      /* Both of these sections are (technically) created by the user
-	 putting data in them, so they shouldn't be marked
-	 SEC_LINKER_CREATED.
+      /* Both of these sections should be marked SEC_LINKER_CREATED so
+	 their contents is allocated in ppc_elf_size_dynamic_sections.
 
 	 The linker creates them so it has somewhere to attach their
-	 respective symbols. In fact, if they were empty it would
-	 be OK to leave the symbol set to 0 (or any random number), because
-	 the appropriate register should never be used.  */
+	 respective symbols. In fact, if they were empty it would be
+	 OK to leave the symbol set to 0 (or any random number),
+	 because the appropriate register should never be used.  Also,
+	 the implicit symbol pointer entries for R_PPC_EMB_SDAI16 and
+	 R_PPC_EMB_SDA2I16 relocations are put there.  */
       defaults.flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
-			| SEC_IN_MEMORY);
+                       | SEC_IN_MEMORY | SEC_LINKER_CREATED);
 
       switch (which)
 	{


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