summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-19 19:52:52 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-19 19:52:52 +0000
commit60ec3836a2c10cf96526ad499af171f3b1c9b170 (patch)
tree74c81024d1a050d2fe5e9b37957bd73ec5b8cf62 /llvm/docs
parentb79d4f82e854bd951e1ac280490f2d632dae08c3 (diff)
downloadbcm5719-llvm-60ec3836a2c10cf96526ad499af171f3b1c9b170.tar.gz
bcm5719-llvm-60ec3836a2c10cf96526ad499af171f3b1c9b170.zip
Support multiple COFF sections with the same name but different COMDAT.
This is the first step to fix pr17918. It extends the .section directive a bit, inspired by what the ELF one looks like. The problem with using linkonce is that given .section foo .linkonce.... .section foo .linkonce we would already have switched sections when getting to .linkonce. The cleanest solution seems to be to add the comdat information in the .section itself. llvm-svn: 195148
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/Extensions.rst38
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/docs/Extensions.rst b/llvm/docs/Extensions.rst
index 925d7279bfa..e308dbcdfc4 100644
--- a/llvm/docs/Extensions.rst
+++ b/llvm/docs/Extensions.rst
@@ -105,3 +105,41 @@ Supported COMDAT types:
.section .xdata$foo
.linkonce associative .text$foo
...
+
+``.section`` Directive
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+MC supports passing the information in ``.linkonce`` at the end of
+``.section``. For example, these two codes are equivalent
+
+.. code-block:: gas
+
+ .section secName, "dr", discard, "Symbol1"
+ .globl Symbol1
+ Symbol1:
+ .long 1
+
+.. code-block:: gas
+
+ .section secName, "dr"
+ .linkonce discard
+ .globl Symbol1
+ Symbol1:
+ .long 1
+
+Note that in the combined form the COMDAT symbol is explict. This
+extension exits to support multiple sections with the same name in
+different comdats:
+
+
+.. code-block:: gas
+
+ .section secName, "dr", discard, "Symbol1"
+ .globl Symbol1
+ Symbol1:
+ .long 1
+
+ .section secName, "dr", discard, "Symbol2"
+ .globl Symbol2
+ Symbol2:
+ .long 1
OpenPOWER on IntegriCloud