aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2006-06-23 16:23:09 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2006-06-23 16:23:09 +0000
commitd58c2e3acdba2aadf3a47d741236fa02d7bb04ff (patch)
treef33571f1e6bfe6c7613b85810616487b7eaf1ac1 /binutils/testsuite
parent22a84b55803f2adae036b553f7ca347ba02744be (diff)
downloadgdb-d58c2e3acdba2aadf3a47d741236fa02d7bb04ff.zip
gdb-d58c2e3acdba2aadf3a47d741236fa02d7bb04ff.tar.gz
gdb-d58c2e3acdba2aadf3a47d741236fa02d7bb04ff.tar.bz2
binutils/
* objcopy.c (localize_hidden): New variable. (OPTION_LOCALIZE_HIDDEN): New command_line_switch value. (copy_options): Add --localize-hidden. (copy_usage): Mention --localize-hidden. (is_hidden_symbol): New function. (filter_symbols): Handle localize_hidden. (copy_object): Call filter_symbols if localize_hidden. (copy_main): Handle OPTION_LOCALIZE_HIDDEN. * doc/binutils.texi (--localize-hidden): Document new option. binutils/testsuite/ * binutils-all/localize-hidden-1.s, * binutils-all/localize-hidden-1.d, * binutils-all/localize-hidden-2.s, * binutils-all/localize-hidden-2.d: New tests. * binutils-all/objcopy.exp: Run them.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog8
-rw-r--r--binutils/testsuite/binutils-all/localize-hidden-1.d17
-rw-r--r--binutils/testsuite/binutils-all/localize-hidden-1.s36
-rw-r--r--binutils/testsuite/binutils-all/localize-hidden-2.d7
-rw-r--r--binutils/testsuite/binutils-all/localize-hidden-2.s2
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp5
6 files changed, 75 insertions, 0 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 0fabcda..dac114f 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2006-06-23 Richard Sandiford <richard@codesourcery.com>
+
+ * binutils-all/localize-hidden-1.s,
+ * binutils-all/localize-hidden-1.d,
+ * binutils-all/localize-hidden-2.s,
+ * binutils-all/localize-hidden-2.d: New tests.
+ * binutils-all/objcopy.exp: Run them.
+
2006-06-06 Paul Brook <paul@codesourcery.com>
* binutils-all/arm/objdump.exp: New file.
diff --git a/binutils/testsuite/binutils-all/localize-hidden-1.d b/binutils/testsuite/binutils-all/localize-hidden-1.d
new file mode 100644
index 0000000..846df4b
--- /dev/null
+++ b/binutils/testsuite/binutils-all/localize-hidden-1.d
@@ -0,0 +1,17 @@
+#PROG: objcopy
+#readelf: --symbols
+#objcopy: --localize-hidden
+#name: --localize-hidden test 1
+#...
+.*: 0+1200 +0 +NOTYPE +LOCAL +HIDDEN +ABS +Lhidden
+.*: 0+1300 +0 +NOTYPE +LOCAL +INTERNAL +ABS +Linternal
+.*: 0+1400 +0 +NOTYPE +LOCAL +PROTECTED +ABS +Lprotected
+.*: 0+1100 +0 +NOTYPE +LOCAL +DEFAULT +ABS +Ldefault
+.*: 0+2200 +0 +NOTYPE +LOCAL +HIDDEN +ABS +Ghidden
+.*: 0+2300 +0 +NOTYPE +LOCAL +INTERNAL +ABS +Ginternal
+.*: 0+3200 +0 +NOTYPE +LOCAL +HIDDEN +ABS +Whidden
+.*: 0+3300 +0 +NOTYPE +LOCAL +INTERNAL +ABS +Winternal
+.*: 0+2100 +0 +NOTYPE +GLOBAL +DEFAULT +ABS +Gdefault
+.*: 0+2400 +0 +NOTYPE +GLOBAL +PROTECTED +ABS +Gprotected
+.*: 0+3100 +0 +NOTYPE +WEAK +DEFAULT +ABS +Wdefault
+.*: 0+3400 +0 +NOTYPE +WEAK +PROTECTED +ABS +Wprotected
diff --git a/binutils/testsuite/binutils-all/localize-hidden-1.s b/binutils/testsuite/binutils-all/localize-hidden-1.s
new file mode 100644
index 0000000..bdaa69d
--- /dev/null
+++ b/binutils/testsuite/binutils-all/localize-hidden-1.s
@@ -0,0 +1,36 @@
+ .globl Gdefault
+ .globl Ghidden
+ .globl Ginternal
+ .globl Gprotected
+
+ .weak Wdefault
+ .weak Whidden
+ .weak Winternal
+ .weak Wprotected
+
+ .hidden Lhidden
+ .hidden Ghidden
+ .hidden Whidden
+
+ .internal Linternal
+ .internal Ginternal
+ .internal Winternal
+
+ .protected Lprotected
+ .protected Gprotected
+ .protected Wprotected
+
+ .equ Ldefault, 0x1100
+ .equ Lhidden, 0x1200
+ .equ Linternal, 0x1300
+ .equ Lprotected, 0x1400
+
+ .equ Gdefault, 0x2100
+ .equ Ghidden, 0x2200
+ .equ Ginternal, 0x2300
+ .equ Gprotected, 0x2400
+
+ .equ Wdefault, 0x3100
+ .equ Whidden, 0x3200
+ .equ Winternal, 0x3300
+ .equ Wprotected, 0x3400
diff --git a/binutils/testsuite/binutils-all/localize-hidden-2.d b/binutils/testsuite/binutils-all/localize-hidden-2.d
new file mode 100644
index 0000000..ed3807a
--- /dev/null
+++ b/binutils/testsuite/binutils-all/localize-hidden-2.d
@@ -0,0 +1,7 @@
+#PROG: objcopy
+#nm: -n
+#objcopy: --localize-hidden
+#name: --localize-hidden test 2
+#...
+0+100 A G
+#pass
diff --git a/binutils/testsuite/binutils-all/localize-hidden-2.s b/binutils/testsuite/binutils-all/localize-hidden-2.s
new file mode 100644
index 0000000..d428c3a
--- /dev/null
+++ b/binutils/testsuite/binutils-all/localize-hidden-2.s
@@ -0,0 +1,2 @@
+ .globl G
+ .equ G,0x100
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 969249d..679eea5 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -728,3 +728,8 @@ if [is_elf_format] {
run_dump_test "copy-2"
run_dump_test "copy-3"
+
+if [is_elf_format] {
+ run_dump_test "localize-hidden-1"
+}
+run_dump_test "localize-hidden-2"