[PATCH] [LLD] Add support for multiple segments with same name

Adhemerval Zanella adhemerval.zanella at linaro.org
Wed May 20 11:28:17 PDT 2015


Hi ruiu, shankar.easwaran,

This patch fixes lld wrong relocation for objects with multiples segments
with same name (mostly due C++ EH cases for COMDAT group sections).

The issue is due the mapping from segments to relocation only the segment's
name is considered. So for cases where the object file constains more than
one segment with same name (.text for instance), some segments relocations
are complete ignored.

The patch changes this by considering the segment index references in the
group section while creating the mapping.  It also adds a small optimization
on handleSectionGroup by avoiding using the string name, but rather the segment
header in the sections mapping (it should be no code generation changes for
this change).

With this change I could see no more failures with SingleSource for x86_64
and only TLS one for aarch64 (which currently misses TLS handling in
backend).  I will still creating testcases, since it will require changes
for yaml2obj and obj2yaml to correct parse and create objects with multiple
segment of the same name.

http://reviews.llvm.org/D9889

Files:
  lib/ReaderWriter/ELF/ELFFile.cpp
  lib/ReaderWriter/ELF/ELFFile.h

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9889.26165.patch
Type: text/x-patch
Size: 12954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150520/4927d7f1/attachment.bin>


More information about the llvm-commits mailing list