Set alignment of common plugin symbol to 1 for For ELF targets.
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 20 Nov 2010 17:34:16 +0000 (17:34 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 20 Nov 2010 17:34:16 +0000 (17:34 +0000)
2010-11-20  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/12246
* plugin.c (asymbol_from_plugin_symbol): Set alignment of
common symbol to 1 for For ELF targets.

ld/ChangeLog
ld/plugin.c

index 9b8826c59650eb3bed71f5233eeb81cc309d5168..330b5474538334ac8d10ec7fdc10038744f4c786 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/12246
+       * plugin.c (asymbol_from_plugin_symbol): Set alignment of
+       common symbol to 1 for For ELF targets.
+
 2010-11-20  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/12247
index 79b39e8b285f811396d6a37212a5893c899ac8a9..c4337d9743c41f39dcac8f31816be023db413a68 100644 (file)
@@ -292,6 +292,9 @@ asymbol_from_plugin_symbol (bfd *abfd, asymbol *asym,
       flags = BSF_GLOBAL;
       section = bfd_com_section_ptr;
       asym->value = ldsym->size;
+      /* For ELF targets, set alignment of common symbol to 1.  */
+      if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+       ((elf_symbol_type *) asym)->internal_elf_sym.st_value = 1;
       break;
 
     default: