diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-07-16 17:37:26 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-07-16 17:37:26 +0000 |
commit | 915bcca52e8f54e7305838bba4d42b3a87d1c6a6 (patch) | |
tree | 3016deafbd82356a9a8b3e103111ccb2add5abda | |
parent | 1f85278f1750261761fe5177ccd6b95633f50217 (diff) | |
download | gdb-915bcca52e8f54e7305838bba4d42b3a87d1c6a6.zip gdb-915bcca52e8f54e7305838bba4d42b3a87d1c6a6.tar.gz gdb-915bcca52e8f54e7305838bba4d42b3a87d1c6a6.tar.bz2 |
gas/
2009-07-16 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (md_assemble): Only check i.operands for AX.
(md_estimate_size_before_relax): Don't relax IFUNC symbols.
gas/testsuite/
2009-07-16 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/i386.exp: Run ifunc and x86-64-ifunc.
* gas/i386/ifunc.d: New,
* gas/i386/ifunc.s: Likewise.
* gas/i386/x86-64-ifunc.d: Likewise.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 6 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ifunc.d | 19 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ifunc.s | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-ifunc.d | 20 |
7 files changed, 72 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index e7605a7..f2f48df 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2009-07-16 H.J. Lu <hongjiu.lu@intel.com> + + * config/tc-i386.c (md_assemble): Only check i.operands for AX. + (md_estimate_size_before_relax): Don't relax IFUNC symbols. + 2009-07-16 Nathan Sidwell <nathan@codesourcery.com> * config/tc-arm.c (md_apply_fix <BFD_RELOC_ARM_TARGET2>): Write diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 7d170f4..f4660b4 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2821,7 +2821,7 @@ md_assemble (char *line) if (i.types[0].bitfield.imm1) i.imm_operands = 0; /* kludge for shift insns. */ - for (j = 0; j < 3; j++) + for (j = 0; j < i.operands; j++) if (i.types[j].bitfield.inoutportreg || i.types[j].bitfield.shiftcount || i.types[j].bitfield.acc @@ -6975,7 +6975,9 @@ md_estimate_size_before_relax (fragP, segment) #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || (IS_ELF && (S_IS_EXTERNAL (fragP->fr_symbol) - || S_IS_WEAK (fragP->fr_symbol))) + || S_IS_WEAK (fragP->fr_symbol) + || ((symbol_get_bfdsym (fragP->fr_symbol)->flags + & BSF_GNU_INDIRECT_FUNCTION)))) #endif #if defined (OBJ_COFF) && defined (TE_PE) || (OUTPUT_FLAVOR == bfd_target_coff_flavour diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 96e1cf0..4337a61 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2009-07-16 H.J. Lu <hongjiu.lu@intel.com> + + * gas/i386/i386.exp: Run ifunc and x86-64-ifunc. + + * gas/i386/ifunc.d: New, + * gas/i386/ifunc.s: Likewise. + * gas/i386/x86-64-ifunc.d: Likewise. + 2009-07-16 Nathan Sidwell <nathan@codesourcery.com> * gas/arm/target-reloc-1.s: New. diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 68211de..72ce860 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -183,6 +183,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] run_dump_test "intel-regs" run_list_test "inval-equ-1" "-al" run_list_test "inval-equ-2" "-al" + run_dump_test "ifunc" } # This is a PE specific test. @@ -338,6 +339,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "reloc64" run_list_test "reloc64" "--defsym _bad_=1" run_dump_test "mixed-mode-reloc64" + run_dump_test "x86-64-ifunc" } set ASFLAGS "$old_ASFLAGS" diff --git a/gas/testsuite/gas/i386/ifunc.d b/gas/testsuite/gas/i386/ifunc.d new file mode 100644 index 0000000..ed933b9 --- /dev/null +++ b/gas/testsuite/gas/i386/ifunc.d @@ -0,0 +1,19 @@ +#objdump: -drw +#name: i386 ifunc + +.*: +file format .* + +Disassembly of section .text: + +0+ <foo>: +[ ]*[a-f0-9]+: e9 fc ff ff ff jmp 1 <foo\+0x1> 1: R_386_PLT32 ifunc + +0+5 <ifunc>: +[ ]*[a-f0-9]+: c3 ret + +0+6 <bar>: +[ ]*[a-f0-9]+: eb 00 jmp 8 <normal> + +0+8 <normal>: +[ ]*[a-f0-9]+: c3 ret +#pass diff --git a/gas/testsuite/gas/i386/ifunc.s b/gas/testsuite/gas/i386/ifunc.s new file mode 100644 index 0000000..021f815 --- /dev/null +++ b/gas/testsuite/gas/i386/ifunc.s @@ -0,0 +1,14 @@ + .global foo + .type foo, @function +foo: + jmp ifunc@PLT + .type ifunc, @gnu_indirect_function +ifunc: + ret + .global bar + .type bar, @function +bar: + jmp normal@PLT + .type normal, @function +normal: + ret diff --git a/gas/testsuite/gas/i386/x86-64-ifunc.d b/gas/testsuite/gas/i386/x86-64-ifunc.d new file mode 100644 index 0000000..586c82a --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-ifunc.d @@ -0,0 +1,20 @@ +#source: ifunc.s +#objdump: -drw +#name: x86-64 ifunc + +.*: +file format .* + +Disassembly of section .text: + +0+ <foo>: +[ ]*[a-f0-9]+: e9 00 00 00 00 jmpq 5 <ifunc> 1: R_X86_64_PLT32 ifunc(\+0xf+c|-0x4) + +0+5 <ifunc>: +[ ]*[a-f0-9]+: c3 retq + +0+6 <bar>: +[ ]*[a-f0-9]+: eb 00 jmp 8 <normal> + +0+8 <normal>: +[ ]*[a-f0-9]+: c3 retq +#pass |