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

[binutils-gdb] ALIGN change affects cris scripts


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d9d11c361cc29bdac2d2d6c38bce329d25abf7af

commit d9d11c361cc29bdac2d2d6c38bce329d25abf7af
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Jul 20 14:29:37 2015 +0930

    ALIGN change affects cris scripts
    
    More fallout from a2c59f28.  This one could have been fixed by simply
    using ". = ALIGN (ABSOLUTE (.), 2);" but it's nicer to align the
    section.
    
    	* emulparams/criself.sh (INIT_ADDR, FINI_ADDR): Define.
    	(INIT_START, FINI_START): Don't ALIGN.
    	* scriptempl/elf.sc (.init, .fini): Apply INIT_ADDR/FINI_ADDR.

Diff:
---
 ld/ChangeLog             | 6 ++++++
 ld/emulparams/criself.sh | 6 ++++--
 ld/scripttempl/elf.sc    | 4 ++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index ba6eded..15137e2 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,11 @@
 2015-07-20  Alan Modra  <amodra@gmail.com>
 
+	* emulparams/criself.sh (INIT_ADDR, FINI_ADDR): Define.
+	(INIT_START, FINI_START): Don't ALIGN.
+	* scriptempl/elf.sc (.init, .fini): Apply INIT_ADDR/FINI_ADDR.
+
+2015-07-20  Alan Modra  <amodra@gmail.com>
+
 	* scripttempl/elf.sc (.ldata, .bss): Align absolute value of dot.
 	* ldexp.c (is_align_conditional): Handle binary ALIGN.
 	(exp_fold_tree_1): Move code setting SEC_KEEP for assignments to
diff --git a/ld/emulparams/criself.sh b/ld/emulparams/criself.sh
index 9c8ab31..dcddc0f 100644
--- a/ld/emulparams/criself.sh
+++ b/ld/emulparams/criself.sh
@@ -55,8 +55,9 @@ OTHER_BSS_END_SYMBOLS='
 '
 OTHER_END_SYMBOLS='PROVIDE (__end = .);'
 
+INIT_ADDR='ALIGN (2)'
+
 INIT_START='
- . = ALIGN(2);
  ___init__start = .;
  PROVIDE (___do_global_ctors = .);
 '
@@ -66,8 +67,9 @@ INIT_END='
  PROVIDE (___init__end = .);
 '
 
+FINI_ADDR='ALIGN (2)'
+
 FINI_START='
- . = ALIGN (2);
  ___fini__start = .;
  PROVIDE (___do_global_dtors = .);
 '
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 5a15a68..37e4351 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -474,7 +474,7 @@ emit_dyn()
 test -n "${NON_ALLOC_DYN}${SEPARATE_CODE}" || emit_dyn
 
 cat <<EOF
-  .init         ${RELOCATING-0} :
+  .init         ${RELOCATING-0}${RELOCATING+${INIT_ADDR}} :
   {
     ${RELOCATING+${INIT_START}}
     KEEP (*(SORT_NONE(.init)))
@@ -495,7 +495,7 @@ cat <<EOF
     *(.gnu.warning)
     ${RELOCATING+${OTHER_TEXT_SECTIONS}}
   } ${FILL}
-  .fini         ${RELOCATING-0} :
+  .fini         ${RELOCATING-0}${RELOCATING+${FINI_ADDR}} :
   {
     ${RELOCATING+${FINI_START}}
     KEEP (*(SORT_NONE(.fini)))


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