aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-02-26 05:34:52 +0000
committerIan Lance Taylor <ian@airs.com>1994-02-26 05:34:52 +0000
commitbff600cfa4e09e2a6b6145fbc72f8b95f549dcbe (patch)
treee0d97e6b643af7cec499b6fdde5bc6fd1da9433d /ld
parent27baca7182ea8cdc7a259b163aa327a0a297e755 (diff)
downloadgdb-bff600cfa4e09e2a6b6145fbc72f8b95f549dcbe.zip
gdb-bff600cfa4e09e2a6b6145fbc72f8b95f549dcbe.tar.gz
gdb-bff600cfa4e09e2a6b6145fbc72f8b95f549dcbe.tar.bz2
* scripttempl/elf.sc: Force all sections to be aligned.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog2
-rw-r--r--ld/scripttempl/elf.sc31
2 files changed, 21 insertions, 12 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9970d9d..4fabc8e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,7 @@
Fri Feb 25 19:12:03 1994 Ian Lance Taylor (ian@cygnus.com)
+ * scripttempl/elf.sc: Force all sections to be aligned.
+
* ldgram.y (section): Reverse the order of memspec_opt and
fill_opt to avoid an ambiguity when both are used.
* ld.texinfo: Changed accordingly.
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index a6f9302..321a35b 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -8,6 +8,8 @@
# (e.g., .PARISC.global)
# EXECUTABLE_SYMBOLS - symbols that must be defined for an
# executable (e.g., _DYNAMIC_LINK)
+# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
+# .bss section besides __bss_start.
#
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
@@ -33,12 +35,16 @@ SECTIONS
CREATE_OBJECT_SYMBOLS
${RELOCATING+_etext = .;}
}
- .init ${RELOCATING+.} ${RELOCATING-0} : { *(.init) } =${NOP-0}
- .fini ${RELOCATING+.} ${RELOCATING-0} : { *(.fini) } =${NOP-0}
- .ctors ${RELOCATING+.} ${RELOCATING-0} : { *(.ctors) }
- .dtors ${RELOCATING+.} ${RELOCATING-0} : { *(.dtors) }
- .rodata ${RELOCATING+.} ${RELOCATING-0} : { *(.rodata) }
- .rodata1 ${RELOCATING+.} ${RELOCATING-0} : { *(.rodata1) }
+ .init ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.init) } =${NOP-0}
+ .fini ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.fini) } =${NOP-0}
+ .ctors ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.ctors) }
+ .dtors ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.dtors) }
+ .rodata ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.rodata) }
+ .rodata1 ${RELOCATING+ALIGN(8)} ${RELOCATING-0} :
+ {
+ *(.rodata1)
+ ${RELOCATING+. = ALIGN(8);}
+ }
${RELOCATING+${OTHER_READONLY_SECTIONS}}
/* also: .hash .dynsym .dynstr .plt(if r/o) .rel.got */
@@ -50,19 +56,20 @@ SECTIONS
{
*(.data)
${CONSTRUCTING+CONSTRUCTORS}
- ${RELOCATING+_edata = .;}
}
- .data1 ${RELOCATING+.} ${RELOCATING-0} : { *(.data1) }
+ .data1 ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.data1) }
${RELOCATING+${OTHER_READWRITE_SECTIONS}}
/* also (before uninitialized portion): .dynamic .got .plt(if r/w)
(or does .dynamic go into its own segment?) */
/* 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+.} ${RELOCATING-0} : { *(.sdata) }
- ${RELOCATING+__bss_start = .};
- .sbss ${RELOCATING+.} ${RELOCATING-0} : { *(.sbss) *(.scommon) }
- .bss ${RELOCATING+.} ${RELOCATING-0} :
+ .sdata ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.sdata) }
+ ${RELOCATING+_edata = .;}
+ ${RELOCATING+__bss_start = ALIGN(8);}
+ ${RELOCATING+${OTHER_BSS_SYMBOLS}}
+ .sbss ${RELOCATING+ALIGN(8)} ${RELOCATING-0} : { *(.sbss) *(.scommon) }
+ .bss ${RELOCATING+ALIGN(8)} ${RELOCATING-0} :
{
*(.bss)
*(COMMON)