<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - llvm-size reports non-write sections under "data""
   href="https://bugs.llvm.org/show_bug.cgi?id=38723">38723</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-size reports non-write sections under "data"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>japaricious@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20778" name="attach_20778" title="Binary that demonstrates the problem">attachment 20778</a> <a href="attachment.cgi?id=20778&action=edit" title="Binary that demonstrates the problem">[details]</a></span>
Binary that demonstrates the problem

Compare these two outputs

LLVM -
<a href="https://github.com/llvm-mirror/llvm/commit/24535f7c19077d02b193bc6225a667f963901eb4">https://github.com/llvm-mirror/llvm/commit/24535f7c19077d02b193bc6225a667f963901eb4</a>

```
$ llvm-size app
   text    data     bss     dec     hex filename
    160    1052       4    1216     4c0 app
```

GNU objdump (GNU Binutils) 2.31.1

```
$ size app
   text    data     bss     dec     hex filename
   1208       4       4    1216     4c0 app
```

Now look at the section headers of the app binary (attached)

```
$ readelf -S app
There are 20 section headers, starting at offset 0x2652c:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf
Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0 
0
  [ 1] .vector_table     PROGBITS        08000000 010000 000400 00   A  0   0 
4
  [ 2] .text             PROGBITS        08000400 010400 0000a0 00  AX  0   0 
2
  [ 3] .rodata           PROGBITS        080004a0 0104a0 000018 00   A  0   0 
4
  [ 4] .data             PROGBITS        20000000 020000 000004 00  WA  0   0 
4
  [ 5] .bss              NOBITS          20000004 020004 000004 00  WA  0   0 
4
  [ 6] .debug_str        PROGBITS        00000000 020004 00114f 01  MS  0   0 
1
  [ 7] .debug_loc        PROGBITS        00000000 021153 000148 00      0   0 
1
  [ 8] .debug_abbrev     PROGBITS        00000000 02129b 00036c 00      0   0 
1
  [ 9] .debug_info       PROGBITS        00000000 021607 001ab0 00      0   0 
1
  [10] .debug_ranges     PROGBITS        00000000 0230b7 000048 00      0   0 
1
  [11] .debug_macinfo    PROGBITS        00000000 0230ff 000001 00      0   0 
1
  [12] .debug_pubnames   PROGBITS        00000000 023100 000a20 00      0   0 
1
  [13] .debug_pubtypes   PROGBITS        00000000 023b20 00096f 00      0   0 
1
  [14] .ARM.attributes   ARM_ATTRIBUTES  00000000 02448f 00002e 00      0   0 
1
  [15] .debug_frame      PROGBITS        00000000 0244c0 000084 00      0   0 
4
  [16] .debug_line       PROGBITS        00000000 024544 0005cd 00      0   0 
1
  [17] .symtab           SYMTAB          00000000 024b14 0017c0 10     18 351 
4
  [18] .strtab           STRTAB          00000000 0262d4 000180 00      0   0 
1
  [19] .shstrtab         STRTAB          00000000 026454 0000d8 00      0   0 
1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  y (purecode), p (processor specific)
```

llvm-size reports `.vector_table`, `.rodata` and `.data` under "data" (1052
bytes) whereas GNU size only reports `.data` under "data" (4 bytes).

I would expect `.vector_table` and `.rodata`, which don't have the write (W)
flag set, to be reported under "text", not "data" -- which what the GNU tool
does</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>