[llvm-bugs] [Bug 40980] New: String table section sizes are wrong when optimization occurs

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 6 09:12:22 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40980

            Bug ID: 40980
           Summary: String table section sizes are wrong when optimization
                    occurs
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-objcopy
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: alexander.v.shaposhnikov at gmail.com,
                    jake.h.ehrlich at gmail.com,
                    jh7370.2008 at my.bristol.ac.uk,
                    llvm-bugs at lists.llvm.org, rupprecht at google.com

llvm-objcopy uses the StringTableBuilder class to generate its string tables.
Its section size is updated any time addString() is called. This is wrong for
two reasons:

1) If no strings are ever added, then the section size is never updated, and
remains the same as the input section size (which is the initial state of the
size).
2) If string optimization occurs as a result of StringTableBuilder's finalize()
method, the size is not updated. Simply updating it after this call is not
correct either, because that happens after assignOffsets(), after which sizes
should remain static.

Both cases should be fixed by finalizing the string table builder before
assignOffsets() is called and updating the section size at that point.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190306/4873ea6c/attachment.html>


More information about the llvm-bugs mailing list