<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 - [ELF] - -defsym incorrectly works with reserved symbols."
   href="https://bugs.llvm.org/show_bug.cgi?id=35744">35744</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ELF] - -defsym incorrectly works with reserved symbols.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>ELF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>grimar@accesssoftek.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Using code from defsym.s:

.globl foo1
 foo1 = 0x123

.global _start
_start:
  movl $foo2, %edx

and invocation:
# RUN: ld.lld -o %t %t.o --defsym=foo2=etext

Produces symbols foo2 and etext with value of 0x201005, what is correct,
though when expression is used instead, i.e:
# RUN: ld.lld -o %t %t.o --defsym=foo2=etext+1
then foo2 symbol value becomes wrong:

  Symbol {
    Name: foo2 (13)
    Value: 0x201000
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .text (0x1)
  }
  Symbol {
    Name: etext (18)
    Value: 0x201005
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .text (0x1)
  }
]</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>