This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: link script PROVIDE bugfix


On Fri, Aug 05, 2005 at 10:55:10AM -0700, H. J. Lu wrote:
> On Fri, Aug 05, 2005 at 01:58:02PM +0930, Alan Modra wrote:
> > On Thu, Aug 04, 2005 at 07:49:37PM +0100, Paul Brook wrote:
> > > elf.sc (and other scripts based on it) already contain ${OTHER_END_SYMBOLS} 
> > 
> > Oops, sorry.  This reintroduces OTHER_BSS_END_SYMBOLS for syms defined
> > at the end of bss, uses OTHER_END_SYMBOLS for syms that belong with
> > _end, and uses OTHER_SYMBOLS for syms at the end of the script.
> > 
> > I've also moved the LARGE_SECTIONS definitions into elf_x86_64.sh since
> > no other target as yet uses them.  They can go back into the main ELF
> > file if and when other targets need them, assuming the same definition
> > works.
> > 
> > 	* emulparams/armelf.sh (OTHER_BSS_END_SYMBOLS): Split out from
> > 	OTHER_END_SYMBOLS.
> > 	* emulparams/armelf_linux.sh: Likewise.
> > 	* emulparams/armnto.sh: Likewise.
> > 	* emulparams/criself.sh: Likewise.
> > 	* emulparams/elf32mcore.sh: Likewise.
> > 	* emulparams/criself.sh (OTHER_SYMBOLS): Define.
> > 	* emulparams/crislinux.sh (OTHER_SYMBOLS): Define.
> > 	(OTHER_END_SYMBOLS): Don't define.
> > 	* emulparams/elf32fr30.sh: Likewise.
> > 	* emulparams/elf64mmix.sh: Likewise.
> > 	* emulparams/hppa64linux.sh: Likewise.
> > 	* emulparams/m32relf.sh: Likewise.
> > 	* emulparams/vxworks.sh: Likewise.
> > 	* scripttempl/armbpabi.sc (OTHER_BSS_SECTIONS): Delete.
> > 	(OTHER_BSS_END_SYMBOLS): Add.
> > 	(OTHER_END_SYMBOLS): Move before current end sym definitions.
> > 	(OTHER_SYMBOLS): Replace OTHER_END_SYMBOLS near end of script.
> > 	* scripttempl/elf.sc: Likewise.
> > 	* scripttempl/elf32sh-symbian.sc: Likewise.
> > 	* scripttempl/elf_chaos.sc: Likewise.
> > 	* scripttempl/elfxtensa.sc: Likewise.
> > 	* scripttempl/iq2000.sc: Likewise.
> > 	* scripttempl/xstormy16.sc: Likewise.
> > 
> > 	* scripttempl/elf.sc (LBSS, LARGE_SECTIONS): Delete.
> > 	(REL_LDATA, REL_LBSS, REL_LRODATA): Delete.
> > 	(REL_LARGE, LARGE_SECTIONS): Add.
> > 	* emulparams/elf_x86_64.sh (LARGE_SECTIONS): Define as script text.
> > 	(REL_LARGE): Define.
> > 	* emulparams/hppa64linux.sh (OTHER_BSS_SECTIONS): Don't define.
> > 	(LARGE_SECTIONS): Define.
> > 	* emulparams/hppa64linux.sh (OTHER_BSS_SECTIONS): Don't define.
> > 	(LARGE_SECTIONS): Define.
> > 
> 
> I think it is a very bad idea to miss use LARGE_SECTIONS for something
> else. That means it is very hard to add new bss/data sections. What is
> wrong with OTHER_BSS_SECTIONS?
> 
> 

This is the patch to bring back OTHER_BSS_SECTIONS.


H.J.
----
2005-08-05  H.J. Lu  <hongjiu.lu@intel.com>

	* emulparams/hppa64linux.sh (OTHER_BSS_SECTIONS): Restore.
	* scripttempl/elf.sc (OTHER_BSS_SECTIONS): Likewise. Support
	LARGE_SECTIONS.
	(LARGE_SECTIONS): Restore.

--- ld/emulparams/hppa64linux.sh.bss	2005-08-05 10:44:03.547192694 -0700
+++ ld/emulparams/hppa64linux.sh	2005-08-05 11:02:22.632848123 -0700
@@ -30,7 +30,7 @@ OTHER_READWRITE_SECTIONS="
 # The PA64 ELF port has two additional bss sections. huge bss and thread bss.
 # Make sure they end up in the appropriate location.  We also have to set
 # __TLS_SIZE to the size of the thread bss section.
-LARGE_SECTIONS="
+OTHER_BSS_SECTIONS="
   .hbss         ${RELOCATING-0} : { *(.hbss) }
   .tbss         ${RELOCATING-0} : { *(.tbss) }
 "
--- ld/scripttempl/elf.sc.bss	2005-08-05 10:44:03.565189741 -0700
+++ ld/scripttempl/elf.sc	2005-08-05 11:08:59.817675653 -0700
@@ -14,6 +14,7 @@
 #		(e.g., .PARISC.global)
 #	OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
 #		(e.g. PPC32 .fixup, .got[12])
+#	OTHER_BSS_SECTIONS - other than .bss .sbss ...
 #	OTHER_SECTIONS - at the end
 #	EXECUTABLE_SYMBOLS - symbols that must be defined for an
 #		executable (e.g., _DYNAMIC_LINK)
@@ -173,13 +174,15 @@ test "${LARGE_SECTIONS}" = "yes" && REL_
   .rela.lbss    ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
   .rel.lrodata  ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
   .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
-test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
+test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
+  ${OTHER_BSS_SECTIONS}
   .lbss ${RELOCATING-0} :
   {
     *(.dynlbss)
     *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
     *(LARGE_COMMON)
-  }
+  }"
+test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
   .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
   {
     *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
@@ -446,6 +449,7 @@ cat <<EOF
       pad the .data section.  */
    ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
   }
+  ${OTHER_BSS_SECTIONS}
   ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
   ${LARGE_SECTIONS}


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