<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Assertion `StringIndexMap.count(s) && "String is not in table!"' failed."
   href="http://llvm.org/bugs/show_bug.cgi?id=22342">22342</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `StringIndexMap.count(s) && "String is not in table!"' failed.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kamatsuka.shun@jp.fujitsu.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13739" name="attach_13739" title="Obtained by clang -O0 -S -save-temps">attachment 13739</a> <a href="attachment.cgi?id=13739&action=edit" title="Obtained by clang -O0 -S -save-temps">[details]</a></span>
Obtained by clang -O0 -S -save-temps

Hi, 

Clang fails to compile the attached code, which includes a function whose
section and name is the same, and specified as an alias. 

<<<<<[section.c]
void sub1(void) __attribute__(( section("sub1"), alias("sub2") ));
void sub2(void) { return; }
<span class="quote">>>>>></span >

% clang ./section.c -O0 -c
clang: /home/kama/llvm/include/llvm/MC/StringTableBuilder.h:53: size_t
llvm::StringTableBuilder::getOffset(llvm::StringRef): Assertion
`StringIndexMap.count(s) && "String is not in table!"' failed.
...

Clang is able to emit an assembler file, but fails to emit an object while gcc
succeeds.
Adding to this, there is a difference in assembler files of gcc and clang.
The section of function b code is in .section a by clang and .text by gcc.

I don'n know which section is correct, but at least the assertion must be
fixed.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>