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] ld-elf/eh4: Pass -z max-page-size=0x200000 -z noseparate-code to ld


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

commit 92d9e363b5ab7f96a2c8e6d3ae86cf8cc91dca9d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Feb 17 05:30:13 2018 -0800

    ld-elf/eh4: Pass -z max-page-size=0x200000 -z noseparate-code to ld
    
    -z separate-code creates separate code LOAD segment, aligns it to the
    maximum page size and places .plt section before .text section.  But
    ld-elf/eh4 passes -Ttext 0x400 to linker to place .text section at
    address 0x400, which is impossible for linker to accomplish:
    
    $ ld -shared -Ttext 0x400 -z separate-code -o x.so eh4.o
    ld: section .eh_frame LMA [0000000000200000,000000000020006b] overlaps section .plt LMA [0000000000200000,000000000020001f]
    
    Since ld-elf/eh4 also checks exact addresses, this patch passes
    -z max-page-size=0x200000 -z noseparate-code to ld.
    
    	PR ld/22845
    	* ld-elf/eh4.d: Pass -z max-page-size=0x200000 -z noseparate-code
    	to ld.

Diff:
---
 ld/ChangeLog              | 6 ++++++
 ld/testsuite/ld-elf/eh4.d | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index f09a6f1..628c278 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2018-02-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/22845
+	* ld-elf/eh4.d: Pass -z max-page-size=0x200000 -z noseparate-code
+	to ld.
+
 2018-02-16  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* testsuite/ld-x86-64/bnd-branch-1-now.d: Add  -z
diff --git a/ld/testsuite/ld-elf/eh4.d b/ld/testsuite/ld-elf/eh4.d
index 6c1cb32..391efb8 100644
--- a/ld/testsuite/ld-elf/eh4.d
+++ b/ld/testsuite/ld-elf/eh4.d
@@ -1,7 +1,7 @@
 #source: eh4.s
 #source: eh4a.s
 #as: --64
-#ld: -melf_x86_64 -shared -Ttext 0x400
+#ld: -melf_x86_64 -shared -Ttext 0x400 -z max-page-size=0x200000 -z noseparate-code
 #readelf: -wf
 #target: x86_64-*-*


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