Issue metadata
Sign in to add a comment
|
llvm-next with lld: image test failed |
||||||||||||||||||||||
Issue description
With llvm-next, build chromeos-chrome with lld.
It failed at image test.
======================================================================
ERROR: TestImportedSymbolsAreAvailable (chromite.cros.test.image_test.SymbolsTest)
Ensure all ELF files' imported symbols are available in ROOT-A.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/mnt/host/source/chromite/cros/test/image_test.py", line 355, in TestImportedSymbolsAreAvailable
imp, exp = self._GetSymbols(full_name)
File "/mnt/host/source/chromite/cros/test/image_test.py", line 329, in _GetSymbols
imp, exp = parseelf.ParseELFSymbols(elf)
File "/mnt/host/source/chromite/lib/parseelf.py", line 80, in ParseELFSymbols
symbol_name = stringtable.get_string(symbol.st_name)
File "/mnt/host/source/chromite/third_party/pyelftools/elftools/elf/sections.py", line 71, in get_string
(offset, table_size))
File "/mnt/host/source/chromite/third_party/pyelftools/elftools/common/utils.py", line 69, in elf_assert
_assert_with_exception(cond, msg, ELFError)
File "/mnt/host/source/chromite/third_party/pyelftools/elftools/common/utils.py", line 95, in _assert_with_exception
raise exception_type(msg)
ELFError: Expected string offset 20000 < table size 133c
,
Sep 25
This is on both samus and kevin board.
,
Sep 25
It seems this is the same root cause as the sandbox one. The order of sections in the final binary. I will dig more and report back.
,
Sep 25
Thanks. Is there any chance that a later commit in LLD has already fixed this?
,
Sep 25
Not really, I will try a patch on LLD to see whether that fixes the issue.
,
Sep 29
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/chromite/+/3749c8e310232e38d0a1bd902d836d5f567b93f5 commit 3749c8e310232e38d0a1bd902d836d5f567b93f5 Author: Yunlian Jiang <yunlian@google.com> Date: Sat Sep 29 07:27:33 2018 parseelf: get size of symbol table by reading section header We use the assumption that symtab ends right before strtab to calculate the number of symbols. This assumption does not hold on binaries linked with LLD. To fix that, we get the symbol table size by reading the section header instead. BUG= chromium:889081 TEST=test_image on image linked with lld. the reported symbol numbers are the same from a vanilla image with/wihout this change. Change-Id: I5d76aeb9edf8c661672166bab279871c890768f2 Reviewed-on: https://chromium-review.googlesource.com/1244399 Commit-Ready: Yunlian Jiang <yunlian@chromium.org> Tested-by: Yunlian Jiang <yunlian@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org> [modify] https://crrev.com/3749c8e310232e38d0a1bd902d836d5f567b93f5/lib/parseelf.py
,
Oct 10
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by cmt...@chromium.org
, Sep 25