hanchenye-llvm-project/lld/test
Sean Silva 09247f8955 Don't push relocation sections onto InputSection<ELFT>::Discarded.RelocSections
Summary:
LLVM3.3 (and earlier) would fail to include a relocation section in
the group that the section it was relocating is in. Object files
affected by this issue have been encountered in the wild when using LLD.

This would result in a siutation like:

  Section {
    Index: 5
    Name: .text._Z3fooIiEvv (6)
    Type: SHT_PROGBITS (0x1)
    Flags [ (0x206)
      SHF_ALLOC (0x2)
      SHF_EXECINSTR (0x4)
      SHF_GROUP (0x200)
    ]
    Address: 0x0
    Offset: 0x48
    Size: 5
    Link: 0
    Info: 0
    AddressAlignment: 1
    EntrySize: 0
  }
  Section {
    Index: 6
    Name: .rela.text._Z3fooIiEvv (1)
    Type: SHT_RELA (0x4)
    Flags [ (0x0)
    ]
    Address: 0x0
    Offset: 0x3F0
    Size: 24
    Link: 8
    Info: 5
    AddressAlignment: 8
    EntrySize: 24
  }

In LLD, during symbol resolution, we discard the section containing the
weak symbol, but this amounts to replacing it with
InputSection<ELFT>::Discarded.
When we later saw the corresponding relocation section, we would then
end up pusing onto InputSection<ELFT>::Discarded.RelocSections, which is
bogus.

Reviewers: ruiu, rafael

Subscribers: llvm-commits, Bigcheese

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

llvm-svn: 259831
2016-02-04 21:41:07 +00:00
..
COFF COFF: Update test for recent llvm-objdump change (r257539). 2016-01-12 23:29:42 +00:00
Driver Rename the gnu flavour to gnu old. 2015-11-16 08:54:19 +00:00
ELF Don't push relocation sections onto InputSection<ELFT>::Discarded.RelocSections 2016-02-04 21:41:07 +00:00
LinkerScript Add PHDR and FILL parsing. 2015-05-28 00:14:58 +00:00
Unit
core Delete unnecessary generality in loadFile. 2015-04-24 15:51:45 +00:00
darwin Add the GC commandline options and throw errors if they are used 2016-01-15 17:39:02 +00:00
mach-o Set CPU_SUBTYPE_LIB64 in mach_header. 2016-02-04 20:43:43 +00:00
old-elf [old ELF] Remove AMDGPU target 2016-01-11 21:40:40 +00:00
CMakeLists.txt [MachO] Use llvm-readobj in lieu of macho-dump. 2015-09-22 17:31:01 +00:00
lit.cfg [ELF] Fix REQUIRES line in amdgpu tests 2016-01-07 05:02:38 +00:00
lit.site.cfg.in