[llvm-bugs] [Bug 41525] New: Stop assuming there's a symbol table when loading relocations

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 17 04:29:12 PDT 2019


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

            Bug ID: 41525
           Summary: Stop assuming there's a symbol table when loading
                    relocations
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-objcopy/strip
          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

It is possible to see an ELF with a relocation section but no symbol table, as
not all relocations require symbols. However, llvm-objcopy assumes that there
is a symbol table if it sees a relocation section, and proceeds to try to use
it when loading relocations, resulting in a crash. The offending code is the
initRelocations function.

In the event that the symbol table does not exist (i.e. sh_link is 0), we
should consider emitting an error if any of the relocations have a non-zero
symbol index.

-- 
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/20190417/2a672113/attachment.html>


More information about the llvm-bugs mailing list