[llvm-bugs] [Bug 43936] New: Don't add symbol name strings to non-alloc string table in program header

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 7 09:11:49 PST 2019


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

            Bug ID: 43936
           Summary: Don't add symbol name strings to non-alloc string
                    table in program header
           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

This is closely related to bug 43935 and bug 43931, but is somewhat separate.

If --add-symbol is run on an ELF with no symbol table, a symbol table is
created. The names of symbols in that symbol table are placed in the first
non-alloc string table section that can be found that is not the section header
string table, falling back to the section header string table if no such
section can be found. It is possible that a string table could be found that is
contained within a program header. If this table is used, the strings will be
"added" to that table, but not actually appear in the output, because within
segments, the program header contents are preserved. It does however change the
section header size (but see also bug 43931). Additionally, if the strings
added are long enough, the names could extend past the end of the program
header, and be written in space after it. I haven't checked exactly what will
happen, but either these strings will be overwritten by something later, or
they themselves will overwrite this data later. Either is bad. The change in
the section header size could also cause layout to be messed up.

We shouldn't pick sections within segments as candidates for the new symbol
table's string table.

Note that bug 43935 means the output file will be invalid, even if this is
fixed.

-- 
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/20191107/91ed7494/attachment-0001.html>


More information about the llvm-bugs mailing list