Make dead-striping to handle reverse edges.
authorRui Ueyama <ruiu@google.com>
Tue, 3 Jun 2014 01:59:02 +0000 (01:59 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 3 Jun 2014 01:59:02 +0000 (01:59 +0000)
commit23487e878b0bbd012a756d92b10af8769d52cd1e
tree0b0ff04241645a99f34612c404331dfdcc672fc5
parentf39d914d337533a8bd1218fd1ac3e494b4e58df1
Make dead-striping to handle reverse edges.

Layout-before edges are no longer used for layout, but they are
still there for dead-stripping. If we would just remove them
from code, LLD would wrongly remove live atoms that were
referenced by layout-befores.

This patch fixes the issue. Before dead-stripping, it scans all
atoms to construct a reverse map for layout-after edges. Dead-
stripping pass uses the map to traverse the graph.

Differential Revision: http://reviews.llvm.org/D3986

llvm-svn: 210057
lld/include/lld/Core/Reference.h
lld/include/lld/Core/Resolver.h
lld/lib/Core/Resolver.cpp
lld/test/core/dead-strip-reverse.objtxt [new file with mode: 0644]