aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pe
diff options
context:
space:
mode:
authorDave Korn <dave.korn@artimi.com>2009-05-19 16:08:08 +0000
committerDave Korn <dave.korn@artimi.com>2009-05-19 16:08:08 +0000
commitc1711530e652a14bc0df9b603c73e350b5dfe5ec (patch)
treef0e82c9c384277dc508547d786bbc912eac7edf8 /ld/testsuite/ld-pe
parentfbdebf465713844d23625ae09e0ae4995418328b (diff)
downloadgdb-c1711530e652a14bc0df9b603c73e350b5dfe5ec.zip
gdb-c1711530e652a14bc0df9b603c73e350b5dfe5ec.tar.gz
gdb-c1711530e652a14bc0df9b603c73e350b5dfe5ec.tar.bz2
==> bfd/ChangeLog <==
2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * cofflink.c (process_embedded_commands): Ignore "-aligncomm". ==> gas/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * NEWS: Mention new feature. * config/obj-coff.c (obj_coff_common_parse): New function. (obj_coff_comm): Likewise. (coff_pseudo_table): Override default ".comm" definition on PE. * doc/as.texinfo: Document new feature. ==> gas/testsuite/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * gas/pe/: New directory for PE format-specific tests. * gas/pe/aligncomm-a.d: New test pattern file. * gas/pe/aligncomm-a.s: New test source file. * gas/pe/aligncomm-b.d: New test pattern file. * gas/pe/aligncomm-b.s: New test source file. * gas/pe/aligncomm-c.d: New test pattern file. * gas/pe/aligncomm-c.s: New test source file. * gas/pe/aligncomm-d.d: New test pattern file. * gas/pe/aligncomm-d.s: New test source file. * gas/pe/pe.exp: New test control script. * lib/gas-defs.exp (is_pecoff_format): New function. ==> ld/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * NEWS: Mention new feature. * deffile.h (def_file_aligncomm): Add new struct definition. (def_file): Add new def_file_aligncomm member. * deffilep.y (%token): Add new ALIGNCOMM token. (command): Add production rule for ALIGNCOMM. (def_file_free): Free any chained def_file_aligncomm structs. (diropts[]): Add entry for '-aligncomm' .drectve command. (def_aligncomm): New grammar function. * ld.texinfo: Document new feature. * pe-dll.c (process_def_file): Rename from this ... (process_def_file_and_drectve): ... to this, updating all callers, and process any aligncomms chained to the def file after scanning all .drectve sections. (generate_edata): Updated to match. (pe_dll_build_sections): Likewise. ==> ld/testsuite/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * ld-pe/aligncomm-1.c: New test source file. * ld-pe/aligncomm-2.c: Likewise. * ld-pe/aligncomm-3.c: Likewise. * ld-pe/aligncomm-4.c: Likewise. * ld-pe/aligncomm.d: New test pattern file. * ld-pe/direct.exp: Deleted, and content moved into ... * ld-pe/pe-run.exp: ... New common file for all PE run tests. * ld-pe/vers-script.exp: Deleted, and content merged into ... * ld-pe/pe-compile.exp: ... New common file for PE tests needing a compiler, adding aligned common tests. * ld-pe/pe.exp: Update header comment.
Diffstat (limited to 'ld/testsuite/ld-pe')
-rwxr-xr-xld/testsuite/ld-pe/aligncomm-1.c19
-rwxr-xr-xld/testsuite/ld-pe/aligncomm-2.c20
-rwxr-xr-xld/testsuite/ld-pe/aligncomm-3.c21
-rwxr-xr-xld/testsuite/ld-pe/aligncomm-4.c22
-rwxr-xr-xld/testsuite/ld-pe/aligncomm.d3
-rwxr-xr-xld/testsuite/ld-pe/pe-compile.exp (renamed from ld/testsuite/ld-pe/vers-script.exp)21
-rwxr-xr-x[-rw-r--r--]ld/testsuite/ld-pe/pe-run.exp (renamed from ld/testsuite/ld-pe/direct.exp)5
-rw-r--r--ld/testsuite/ld-pe/pe.exp2
8 files changed, 107 insertions, 6 deletions
diff --git a/ld/testsuite/ld-pe/aligncomm-1.c b/ld/testsuite/ld-pe/aligncomm-1.c
new file mode 100755
index 0000000..44f576e
--- /dev/null
+++ b/ld/testsuite/ld-pe/aligncomm-1.c
@@ -0,0 +1,19 @@
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+long s1 = 0;
+__m128 r;
+__m128 * volatile raddr = &r;
+
+int main (int argc, const char **argv)
+{
+ return 15 & (int)raddr;
+}
+
+void __main (void)
+{
+ asm (".section .drectve\n"
+ " .ascii \" -aligncomm:_r,4\"\n"
+ " .ascii \" -aligncomm:r,4\"\n"
+ " .text");
+}
diff --git a/ld/testsuite/ld-pe/aligncomm-2.c b/ld/testsuite/ld-pe/aligncomm-2.c
new file mode 100755
index 0000000..3b33362
--- /dev/null
+++ b/ld/testsuite/ld-pe/aligncomm-2.c
@@ -0,0 +1,20 @@
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+long s1 = 0;
+long s2 = 0;
+__m128 r;
+__m128 * volatile raddr = &r;
+
+int main (int argc, const char **argv)
+{
+ return 15 & (int)raddr;
+}
+
+void __main (void)
+{
+ asm (".section .drectve\n"
+ " .ascii \" -aligncomm:_r,4\"\n"
+ " .ascii \" -aligncomm:r,4\"\n"
+ " .text");
+}
diff --git a/ld/testsuite/ld-pe/aligncomm-3.c b/ld/testsuite/ld-pe/aligncomm-3.c
new file mode 100755
index 0000000..04fdfd1
--- /dev/null
+++ b/ld/testsuite/ld-pe/aligncomm-3.c
@@ -0,0 +1,21 @@
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+long s1 = 0;
+long s2 = 0;
+long s3 = 0;
+__m128 r;
+__m128 * volatile raddr = &r;
+
+int main (int argc, const char **argv)
+{
+ return 15 & (int)raddr;
+}
+
+void __main (void)
+{
+ asm (".section .drectve\n"
+ " .ascii \" -aligncomm:_r,4\"\n"
+ " .ascii \" -aligncomm:r,4\"\n"
+ " .text");
+}
diff --git a/ld/testsuite/ld-pe/aligncomm-4.c b/ld/testsuite/ld-pe/aligncomm-4.c
new file mode 100755
index 0000000..854d9ba
--- /dev/null
+++ b/ld/testsuite/ld-pe/aligncomm-4.c
@@ -0,0 +1,22 @@
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+long s1 = 0;
+long s2 = 0;
+long s3 = 0;
+long s4 = 0;
+__m128 r;
+__m128 * volatile raddr = &r;
+
+int main (int argc, const char **argv)
+{
+ return 15 & (int)raddr;
+}
+
+void __main (void)
+{
+ asm (".section .drectve\n"
+ " .ascii \" -aligncomm:_r,4\"\n"
+ " .ascii \" -aligncomm:r,4\"\n"
+ " .text");
+}
diff --git a/ld/testsuite/ld-pe/aligncomm.d b/ld/testsuite/ld-pe/aligncomm.d
new file mode 100755
index 0000000..6f33644
--- /dev/null
+++ b/ld/testsuite/ld-pe/aligncomm.d
@@ -0,0 +1,3 @@
+#...
+[0-9a-fA-F]{7,15}0 . r
+#...
diff --git a/ld/testsuite/ld-pe/vers-script.exp b/ld/testsuite/ld-pe/pe-compile.exp
index e0638b1..b9bc4af 100755
--- a/ld/testsuite/ld-pe/vers-script.exp
+++ b/ld/testsuite/ld-pe/pe-compile.exp
@@ -1,4 +1,5 @@
-# Expect script for version-script driven export from dll tests
+# Expect script for complex PE tests that require a C compiler
+# in addition to the just-built binutils.
# Copyright 2009
# Free Software Foundation, Inc.
#
@@ -20,7 +21,7 @@
# MA 02110-1301, USA.
#
-# This test can only be run on PE/COFF platforms.
+# These tests can only be run on PE/COFF platforms.
if {![is_pecoff_format]} {
return
}
@@ -28,6 +29,8 @@ if {![is_pecoff_format]} {
# No compiler, no test.
if { [which $CC] == 0 } {
untested "PE version scripts"
+ untested "aligned common tests"
+ # Add more "untested" directives here when adding more tests below.
return
}
@@ -36,7 +39,7 @@ proc build_vers_script_dll_o {} {
global CFLAGS
global srcdir
global subdir
-
+
# Compile the object file.
if ![ld_compile "$CC $CFLAGS -shared" $srcdir/$subdir/vers-script-dll.c tmpdir/vers-script-dll.o] {
fail "compiling shared lib object"
@@ -74,3 +77,15 @@ run_ver_script_test "vers-script-2"
run_ver_script_test "vers-script-3"
run_ver_script_test "vers-script-4"
+set align_tests {
+ {"aligned common 1" "" "" {aligncomm-1.c}
+ {{nm -C aligncomm.d}} "aligncomm-1.x"}
+ {"aligned common 2" "" "" {aligncomm-2.c}
+ {{nm -C aligncomm.d}} "aligncomm-2.x"}
+ {"aligned common 3" "" "" {aligncomm-3.c}
+ {{nm -C aligncomm.d}} "aligncomm-3.x"}
+ {"aligned common 4" "" "" {aligncomm-4.c}
+ {{nm -C aligncomm.d}} "aligncomm-4.x"}
+}
+
+run_ld_link_tests $align_tests
diff --git a/ld/testsuite/ld-pe/direct.exp b/ld/testsuite/ld-pe/pe-run.exp
index b4bb629..3e7c356 100644..100755
--- a/ld/testsuite/ld-pe/direct.exp
+++ b/ld/testsuite/ld-pe/pe-run.exp
@@ -1,4 +1,5 @@
-# Expect script for direct linking from dll tests
+# Expect script for complex PE tests that require a C compiler and the ability
+# to run target executables natively, in addition to the just-built binutils.
# Copyright 2006, 2007
# Free Software Foundation, Inc.
#
@@ -67,7 +68,7 @@ proc test_direct_link_dll {} {
global srcdir
global subdir
global tmpdir
-
+
# Compile the dll.
if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/direct_dll.c $tmpdir/direct_dll.o ] {
fail "compiling shared lib"
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index ad91f06..3fcf8cb 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -1,4 +1,4 @@
-# Expect script for export table in executables tests
+# Expect script for simple PE tests that require the just-built binutils only.
# Copyright 2004, 2006, 2007
# Free Software Foundation, Inc.
#