aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-01-31 17:54:39 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-01-31 17:54:39 +0000
commitb7761f11062dc4d4fd554342ac2d2fb235b65b7a (patch)
treed9c62c5953b92ddbab90f35cf3281df5130e8073 /ld
parentab2d2ad35dc6107292e37384f6da309aa19774ba (diff)
downloadfsf-binutils-gdb-b7761f11062dc4d4fd554342ac2d2fb235b65b7a.zip
fsf-binutils-gdb-b7761f11062dc4d4fd554342ac2d2fb235b65b7a.tar.gz
fsf-binutils-gdb-b7761f11062dc4d4fd554342ac2d2fb235b65b7a.tar.bz2
Support arch-dependent fill
bfd/ 2012-01-31 H.J. Lu <hongjiu.lu@intel.com> PR ld/13616 * archures.c (bfd_arch_info): Add fill. (bfd_default_arch_struct): Add bfd_arch_default_fill. (bfd_arch_default_fill): New. * configure.in: Set bfd version to 2.22.52. * configure: Regenerated. * cpu-alpha.c: Add bfd_arch_default_fill to bfd_arch_info initializer. * cpu-arc.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-cris.c: Likewise. * cpu-crx.c: Likewise. * cpu-d10v.c: Likewise. * cpu-d30v.c: Likewise. * cpu-dlx.c: Likewise. * cpu-epiphany.c: Likewise. * cpu-fr30.c: Likewise. * cpu-frv.c: Likewise. * cpu-h8300.c: Likewise. * cpu-h8500.c: Likewise. * cpu-hppa.c: Likewise. * cpu-i370.c: Likewise. * cpu-i860.c: Likewise. * cpu-i960.c: Likewise. * cpu-ia64.c: Likewise. * cpu-ip2k.c: Likewise. * cpu-iq2000.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m10200.c: Likewise. * cpu-m10300.c: Likewise. * cpu-m32c.c: Likewise. * cpu-m32r.c: Likewise. * cpu-m68hc11.c: Likewise. * cpu-m68hc12.c: Likewise. * cpu-m68k.c: Likewise. * cpu-m88k.c: Likewise. * cpu-mcore.c: Likewise. * cpu-mep.c: Likewise. * cpu-microblaze.c: Likewise. * cpu-mips.c: Likewise. * cpu-mmix.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-mt.c: Likewise. * cpu-ns32k.c: Likewise. * cpu-openrisc.c: Likewise. * cpu-or32.c: Likewise. * cpu-pdp11.c: Likewise. * cpu-pj.c: Likewise. * cpu-plugin.c: Likewise. * cpu-powerpc.c: Likewise. * cpu-rl78.c: Likewise. * cpu-rs6000.c: Likewise. * cpu-rx.c: Likewise. * cpu-s390.c: Likewise. * cpu-score.c: Likewise. * cpu-sh.c: Likewise. * cpu-sparc.c: Likewise. * cpu-spu.c: Likewise. * cpu-tic30.c: Likewise. * cpu-tic4x.c: Likewise. * cpu-tic54x.c: Likewise. * cpu-tic6x.c: Likewise. * cpu-tic80.c: Likewise. * cpu-tilegx.c: Likewise. * cpu-tilepro.c: Likewise. * cpu-v850.c: Likewise. * cpu-vax.c: Likewise. * cpu-w65.c: Likewise. * cpu-we32k.c: Likewise. * cpu-xc16x.c: Likewise. * cpu-xstormy16.c: Likewise. * cpu-xtensa.c: Likewise. * cpu-z80.c: Likewise. * cpu-z8k.c: Likewise. * cpu-i386.c: Include "libiberty.h". (bfd_arch_i386_fill): New. Add bfd_arch_i386_fill to bfd_arch_info initializer. * cpu-k1om.c: Add bfd_arch_i386_fill to bfd_arch_info initializer. * cpu-l1om.c: Likewise. * linker.c (default_data_link_order): Call abfd->arch_info->fill if fill size is 0. * bfd-in2.h: Regenerated. include/ 2012-01-31 H.J. Lu <hongjiu.lu@intel.com> PR ld/13616 * bfdlink.h (bfd_link_order): Update comments on data size. ld/ 2012-01-31 H.J. Lu <hongjiu.lu@intel.com> PR ld/13616 * emulparams/elf32_x86_64.sh: Remove NOP. * emulparams/elf_i386.sh: Likewise. * emulparams/elf_i386_be.sh: Likewise. * emulparams/elf_i386_ldso.sh: Likewise. * emulparams/elf_i386_vxworks.sh: Likewise. * emulparams/elf_k1om.sh: Likewise. * emulparams/elf_l1om.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * ldlang.c (zero_fill): Initialized to 0. * ldwrite.c (build_link_order): Set data size to linker odrder size when they are the same. * scripttempl/elf.sc: Don't specify fill if NOP is undefined. ld/testsuite/ 2012-01-31 H.J. Lu <hongjiu.lu@intel.com> PR ld/13616 * ld-i386/tlsbindesc.dd: Update no-op padding. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlsbindesc.dd: Likewise. * ld-x86-64/tlspic.dd: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog19
-rw-r--r--ld/emulparams/elf32_x86_64.sh1
-rw-r--r--ld/emulparams/elf_i386.sh1
-rw-r--r--ld/emulparams/elf_i386_be.sh1
-rw-r--r--ld/emulparams/elf_i386_ldso.sh1
-rw-r--r--ld/emulparams/elf_i386_vxworks.sh1
-rw-r--r--ld/emulparams/elf_k1om.sh1
-rw-r--r--ld/emulparams/elf_l1om.sh1
-rw-r--r--ld/emulparams/elf_x86_64.sh1
-rw-r--r--ld/ldlang.c2
-rw-r--r--ld/ldwrite.c1
-rw-r--r--ld/scripttempl/elf.sc14
-rw-r--r--ld/testsuite/ChangeLog10
-rw-r--r--ld/testsuite/ld-i386/tlsbindesc.dd3
-rw-r--r--ld/testsuite/ld-i386/tlsnopic.dd4
-rw-r--r--ld/testsuite/ld-i386/tlspic.dd4
-rw-r--r--ld/testsuite/ld-x86-64/tlsbin.dd4
-rw-r--r--ld/testsuite/ld-x86-64/tlsbindesc.dd4
-rw-r--r--ld/testsuite/ld-x86-64/tlspic.dd3
19 files changed, 47 insertions, 29 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 20c35b1..00075ed 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,22 @@
+2012-01-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/13616
+ * emulparams/elf32_x86_64.sh: Remove NOP.
+ * emulparams/elf_i386.sh: Likewise.
+ * emulparams/elf_i386_be.sh: Likewise.
+ * emulparams/elf_i386_ldso.sh: Likewise.
+ * emulparams/elf_i386_vxworks.sh: Likewise.
+ * emulparams/elf_k1om.sh: Likewise.
+ * emulparams/elf_l1om.sh: Likewise.
+ * emulparams/elf_x86_64.sh: Likewise.
+
+ * ldlang.c (zero_fill): Initialized to 0.
+
+ * ldwrite.c (build_link_order): Set data size to linker odrder
+ size when they are the same.
+
+ * scripttempl/elf.sc: Don't specify fill if NOP is undefined.
+
2012-01-17 Alan Modra <amodra@gmail.com>
* ldver.c (ldversion): Update copyright message year.
diff --git a/ld/emulparams/elf32_x86_64.sh b/ld/emulparams/elf32_x86_64.sh
index d26a67f..fb94003 100644
--- a/ld/emulparams/elf32_x86_64.sh
+++ b/ld/emulparams/elf32_x86_64.sh
@@ -8,7 +8,6 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH="i386:x64-32"
MACHINE=
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/emulparams/elf_i386.sh b/ld/emulparams/elf_i386.sh
index 1d1e4b4..2b2f910 100644
--- a/ld/emulparams/elf_i386.sh
+++ b/ld/emulparams/elf_i386.sh
@@ -7,7 +7,6 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH=i386
MACHINE=
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/emulparams/elf_i386_be.sh b/ld/emulparams/elf_i386_be.sh
index efe1a86..1e27faa 100644
--- a/ld/emulparams/elf_i386_be.sh
+++ b/ld/emulparams/elf_i386_be.sh
@@ -5,7 +5,6 @@ TEXT_START_ADDR=0x80000000
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=i386
MACHINE=
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
NO_SMALL_DATA=yes
diff --git a/ld/emulparams/elf_i386_ldso.sh b/ld/emulparams/elf_i386_ldso.sh
index 183731d..e1a2cb7 100644
--- a/ld/emulparams/elf_i386_ldso.sh
+++ b/ld/emulparams/elf_i386_ldso.sh
@@ -6,7 +6,6 @@ TEXT_START_ADDR=0x08048000
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
ARCH=i386
MACHINE=
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
ELF_INTERPRETER_NAME=\"/usr/lib/ld.so.1\"
diff --git a/ld/emulparams/elf_i386_vxworks.sh b/ld/emulparams/elf_i386_vxworks.sh
index 6933128..61839c8 100644
--- a/ld/emulparams/elf_i386_vxworks.sh
+++ b/ld/emulparams/elf_i386_vxworks.sh
@@ -6,7 +6,6 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH=i386
MACHINE=
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/emulparams/elf_k1om.sh b/ld/emulparams/elf_k1om.sh
index ad4b955..d28ffc0 100644
--- a/ld/emulparams/elf_k1om.sh
+++ b/ld/emulparams/elf_k1om.sh
@@ -9,7 +9,6 @@ COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH="k1om"
MACHINE=
COMPILE_IN=yes
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/emulparams/elf_l1om.sh b/ld/emulparams/elf_l1om.sh
index 1d22d69..80152fe 100644
--- a/ld/emulparams/elf_l1om.sh
+++ b/ld/emulparams/elf_l1om.sh
@@ -9,7 +9,6 @@ COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH="l1om"
MACHINE=
COMPILE_IN=yes
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index a921878..c38e845 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -8,7 +8,6 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
ARCH="i386:x86-64"
MACHINE=
-NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
GENERATE_PIE_SCRIPT=yes
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 5e01fc0..24fd7da 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -4600,7 +4600,7 @@ insert_pad (lang_statement_union_type **ptr,
asection *output_section,
bfd_vma dot)
{
- static fill_type zero_fill = { 1, { 0 } };
+ static fill_type zero_fill;
lang_statement_union_type *pad = NULL;
if (ptr != &statement_list.head)
diff --git a/ld/ldwrite.c b/ld/ldwrite.c
index b7a1469..481fef4 100644
--- a/ld/ldwrite.c
+++ b/ld/ldwrite.c
@@ -183,6 +183,7 @@ build_link_order (lang_statement_union_type *statement)
default:
abort ();
}
+ link_order->u.data.size = link_order->size;
}
break;
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 149eec7..7994b5f 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -1,6 +1,6 @@
#
# Unusual variables checked by this code:
-# NOP - four byte opcode for no-op (defaults to 0)
+# NOP - four byte opcode for no-op (defaults to none)
# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
# empty.
# SMALL_DATA_CTOR - .ctors contains small data.
@@ -91,6 +91,12 @@
#
# Each of these can also have corresponding .rel.* and .rela.* sections.
+if test -n "$NOP"; then
+ FILL="=$NOP"
+else
+ FILL=
+fi
+
test -z "$RODATA_NAME" && RODATA_NAME=rodata
test -z "$SDATA_NAME" && SDATA_NAME=sdata
test -z "$SBSS_NAME" && SBSS_NAME=sbss
@@ -438,7 +444,7 @@ cat <<EOF
${RELOCATING+${INIT_START}}
KEEP (*(.init))
${RELOCATING+${INIT_END}}
- } =${NOP-0}
+ } ${FILL}
${TEXT_PLT+${PLT}}
${TINY_READONLY_SECTION}
@@ -453,13 +459,13 @@ cat <<EOF
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}}
- } =${NOP-0}
+ } ${FILL}
.fini ${RELOCATING-0} :
{
${RELOCATING+${FINI_START}}
KEEP (*(.fini))
${RELOCATING+${FINI_END}}
- } =${NOP-0}
+ } ${FILL}
${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index efeed55..037bfa0 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2012-01-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/13616
+ * ld-i386/tlsbindesc.dd: Update no-op padding.
+ * ld-i386/tlsnopic.dd: Likewise.
+ * ld-i386/tlspic.dd: Likewise.
+ * ld-x86-64/tlsbin.dd: Likewise.
+ * ld-x86-64/tlsbindesc.dd: Likewise.
+ * ld-x86-64/tlspic.dd: Likewise.
+
2012-01-17 Alan Modra <amodra@gmail.com>
* config/default.exp: Provide tmpdir/ld/collect-ld.
diff --git a/ld/testsuite/ld-i386/tlsbindesc.dd b/ld/testsuite/ld-i386/tlsbindesc.dd
index db54764..79a26d1 100644
--- a/ld/testsuite/ld-i386/tlsbindesc.dd
+++ b/ld/testsuite/ld-i386/tlsbindesc.dd
@@ -223,8 +223,7 @@ Disassembly of section .text:
[0-9a-f]+: 8b 5d fc[ ]+mov -0x4\(%ebp\),%ebx
[0-9a-f]+: c9[ ]+leave *
[0-9a-f]+: c3[ ]+ret *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
+ [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
[0-9a-f]+ <_start>:
[0-9a-f]+: 55[ ]+push %ebp
diff --git a/ld/testsuite/ld-i386/tlsnopic.dd b/ld/testsuite/ld-i386/tlsnopic.dd
index 995cdaa..d6a16d0 100644
--- a/ld/testsuite/ld-i386/tlsnopic.dd
+++ b/ld/testsuite/ld-i386/tlsnopic.dd
@@ -156,6 +156,4 @@ Disassembly of section .text:
10ec: 8b 5d fc[ ]+mov -0x4\(%ebp\),%ebx
10ef: c9[ ]+leave *
10f0: c3[ ]+ret *
- 10f1: 90[ ]+nop *
- 10f2: 90[ ]+nop *
- 10f3: 90[ ]+nop *
+ 10f1: 0f 1f 00[ ]+nopl \(%eax\)
diff --git a/ld/testsuite/ld-i386/tlspic.dd b/ld/testsuite/ld-i386/tlspic.dd
index b0c046d..d85b385 100644
--- a/ld/testsuite/ld-i386/tlspic.dd
+++ b/ld/testsuite/ld-i386/tlspic.dd
@@ -406,6 +406,4 @@ Disassembly of section .text:
[0-9a-f]+: 8b 5d fc[ ]+mov -0x4\(%ebp\),%ebx
[0-9a-f]+: c9[ ]+leave *
[0-9a-f]+: c3[ ]+ret *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
+ [0-9a-f]+: 0f 1f 00[ ]+nopl \(%eax\)
diff --git a/ld/testsuite/ld-x86-64/tlsbin.dd b/ld/testsuite/ld-x86-64/tlsbin.dd
index 5bb5979..e028753 100644
--- a/ld/testsuite/ld-x86-64/tlsbin.dd
+++ b/ld/testsuite/ld-x86-64/tlsbin.dd
@@ -174,9 +174,7 @@ Disassembly of section .text:
401136: 90[ ]+nop *
401137: c9[ ]+leaveq *
401138: c3[ ]+retq *
- 401139: 90[ ]+nop *
- 40113a: 90[ ]+nop *
- 40113b: 90[ ]+nop *
+ 401139: 0f 1f 00[ ]+nopl \(%rax\)
0+40113c <_start>:
40113c: 55[ ]+push %rbp
diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.dd b/ld/testsuite/ld-x86-64/tlsbindesc.dd
index b1cfacb..03f0169 100644
--- a/ld/testsuite/ld-x86-64/tlsbindesc.dd
+++ b/ld/testsuite/ld-x86-64/tlsbindesc.dd
@@ -165,9 +165,7 @@ Disassembly of section .text:
[0-9a-f]+: 90[ ]+nop *
[0-9a-f]+: c9[ ]+leaveq *
[0-9a-f]+: c3[ ]+retq *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
+ [0-9a-f]+: 0f 1f 00[ ]+nopl \(%rax\)
[0-9a-f]+ <_start>:
[0-9a-f]+: 55[ ]+push %rbp
diff --git a/ld/testsuite/ld-x86-64/tlspic.dd b/ld/testsuite/ld-x86-64/tlspic.dd
index 6f55456..0c474a9 100644
--- a/ld/testsuite/ld-x86-64/tlspic.dd
+++ b/ld/testsuite/ld-x86-64/tlspic.dd
@@ -226,5 +226,4 @@ Disassembly of section .text:
+11a7: 90[ ]+nop *
+11a8: c9[ ]+leaveq *
+11a9: c3[ ]+retq *
- +11aa: 90[ ]+nop *
- +11ab: 90[ ]+nop *
+ +11aa: 66 90[ ]+xchg %ax,%ax