[Lldb-commits] [PATCH] D16186: Unconditionally accept symbol sizes from .dynsym
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 14 11:07:26 PST 2016
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.
In http://reviews.llvm.org/D16186#327081, @tberghammer wrote:
> I looked through the sections we have in a striped elf file and non of them have any information what would tell us the start address of the functions (it isn't needed in runtime so it is removed to decrease the size).
> Relocations won't really help because they will only reference the start of the public/global functions where we already have the start address from dynsym.
> .eh_frame is a useful information source, but it isn't complete for several reasons. It is only present for non leaf functions (if the compiler is smart enough) and one eh_frame entry can belong to several functions (very common on arm where we use .ARM.exidx instead of .eh_frame). Currently if we don't have a symbol name for a function then we try to create a fake symbol for it based on the eh_frame but this is the behavior what is stopped by the extension of the 0 sized symbols because the symbol size extension will cover addresses where we originally didn't have any symbol. With leaving the 0 size symbols valid I would like to get this behavior back ti work (it works when the last symbol before the address had a non 0 size).
Should we try to use EH frame set the size of any zero sizes symbols?
> Do you remember what was the original reason for changing the size of the symbols from 0 to the address of the next symbol? I think it would be a good idea to completely remove that logic but I am not sure if it would break somebody or not.
This was done for MachO because we don't have sizes in our symbol table. You can probably just remove it and say that the size is valid always because ELF does have a symbol size. We needed to do this in MachO, but it isn't necessary in ELF. So try removing it and running the test suite, if all passes, then just make it so for all symbols (both .symtab and .dynsym).
More information about the lldb-commits