ld-elf/eh4: Pass -z max-page-size=0x200000 -z noseparate-code to ld
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 17 Feb 2018 13:30:13 +0000 (05:30 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 17 Feb 2018 13:31:15 +0000 (05:31 -0800)
-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.

ld/ChangeLog
ld/testsuite/ld-elf/eh4.d

index f09a6f1bffb8dd7cecf9453c5b66786cdf1ecee7..628c27840bd6abae87ecfddf22c38c93f940d2ab 100644 (file)
@@ -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
index 6c1cb320d10a68d4d57b158b9a7f7802e33531e4..391efb8cd2a85c548418924d4a82a17aa72b63f4 100644 (file)
@@ -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-*-*
 
This page took 0.026185 seconds and 4 git commands to generate.