aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/NEWS4
-rw-r--r--gas/config/obj-elf.c16
-rw-r--r--gas/doc/as.texinfo5
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/elf/type.e1
-rw-r--r--gas/testsuite/gas/elf/type.s11
7 files changed, 48 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 8f150fc..de98024 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-23 Ulrich Drepper <drepper@redhat.com>
+
+ * config/obj-elf.c (obj_elf_type): Add code to support a type of
+ gnu_unique_object.
+ * doc/as.texinfo: Document new feature of .type directive.
+ * NEWS: Mention support for gnu_unique_object symbol type.
+
2009-07-23 Nick Clifton <nickc@redhat.com>
PR binutils/10379
diff --git a/gas/NEWS b/gas/NEWS
index 529f4ab..c2eea84 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -1,4 +1,8 @@
-*- text -*-
+* GNU/Linux targets now supports "gnu_unique_object" as a value in the .type
+ pseudo op. It marks the symbol as being globally unique in the entire
+ process.
+
* ARM assembler now supports .inst[.nw] pseudo-ops to insert opcodes specified
in binary rather than text.
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 3c72326..c9c7a9c 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1665,8 +1665,8 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
}
}
else if (strcmp (typename, "gnu_indirect_function") == 0
- || strcmp (typename, "10") == 0
- || strcmp (typename, "STT_GNU_IFUNC") == 0)
+ || strcmp (typename, "10") == 0
+ || strcmp (typename, "STT_GNU_IFUNC") == 0)
{
const struct elf_backend_data *bed;
@@ -1678,6 +1678,18 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
typename);
type = BSF_FUNCTION | BSF_GNU_INDIRECT_FUNCTION;
}
+ else if (strcmp (typename, "gnu_unique_object") == 0)
+ {
+ const struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (stdoutput);
+ if (!(bed->elf_osabi == ELFOSABI_LINUX
+ /* GNU/Linux is still using the default value 0. */
+ || bed->elf_osabi == ELFOSABI_NONE))
+ as_bad (_("symbol type \"%s\" is supported only by GNU targets"),
+ typename);
+ type = BSF_OBJECT | BSF_GNU_UNIQUE;
+ }
#ifdef md_elf_symbol_type
else if ((type = md_elf_symbol_type (typename, sym, elfsym)) != -1)
;
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index d1240bf..3af86f8 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -6360,6 +6360,11 @@ Mark the symbol as being a common data object.
@itemx notype
Does not mark the symbol in any way. It is supported just for completeness.
+@item gnu_unique_object
+Marks the symbol as being a globally unique data object. The dynamic linker
+will make sure that in the entire process there is just one symbol with this
+name and type in use. (This is only supported on Linux targeted assemblers).
+
@end table
Note: Some targets support extra types in addition to those listed above.
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index a5d0bdb..a30164b 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-23 Ulrich Drepper <drepper@redhat.com>
+
+ * gas/elf/type.s: Add unique global symbol definition.
+ * gas/elf/type.e: Add expected readelf output for global unique
+ symbol.
+
2009-07-21 H.J. Lu <hongjiu.lu@intel.com>
PR gas/10420
diff --git a/gas/testsuite/gas/elf/type.e b/gas/testsuite/gas/elf/type.e
index 95d846a..2d26af8 100644
--- a/gas/testsuite/gas/elf/type.e
+++ b/gas/testsuite/gas/elf/type.e
@@ -3,4 +3,5 @@
.: 0+0 1 OBJECT LOCAL DEFAULT . object
.: 0+1 1 TLS LOCAL DEFAULT . tls_object
..: 0+2 1 NOTYPE LOCAL DEFAULT . notype
+ ..: 0+3 1 OBJECT UNIQUE DEFAULT . unique_global
..: 0+1 1 (COMMON|OBJECT) GLOBAL DEFAULT COM common
diff --git a/gas/testsuite/gas/elf/type.s b/gas/testsuite/gas/elf/type.s
index 8620cc2..159bf6d 100644
--- a/gas/testsuite/gas/elf/type.s
+++ b/gas/testsuite/gas/elf/type.s
@@ -1,24 +1,35 @@
.text
+
.size function,1
.type function,%function
function:
.byte 0x0
+
.size indirect_function,1
.type indirect_function,%gnu_indirect_function
indirect_function:
.byte 0x0
+
.data
+
.type object,%object
.size object,1
object:
.byte 0x0
.type tls_object,%tls_object
+
.size tls_object,1
tls_object:
.byte 0x0
.type notype,%notype
+
.size notype,1
notype:
.byte 0x0
.comm common, 1
.type common,STT_COMMON
+
+ .type unique_global,%gnu_unique_object
+unique_global:
+ .byte 0x0
+ .size unique_global,1