[PATCH] D40967: [LLD][ELF] Remove Duplicate .ARM.exidx sections

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 03:49:38 PST 2017


peter.smith added a comment.

Comments from Rafael via [llvm-commits]

> 
> 
>> +  struct ExidxEntry {
>>  +    uint32_t Fn;
>>  +    uint32_t Unwind;
>>  +  };
>>  +
>>  +  // Get the last table Entry from the previous .ARM.exidx section.
>>  +  const ExidxEntry PrevEntry = *reinterpret_cast<const ExidxEntry *>(
>>  +      Prev->Data.data() + Prev->getSize() - sizeof(ExidxEntry));
>>  +  if (IsExtabRef(PrevEntry.Unwind))
>>  +    return false;
> 
> This is not safe in a big endian host, no?

I've updated the structure to contain ulittle32_t to match the original introduction in https://reviews.llvm.org/D25127. I'm happy to do it another way if you'd prefer.

> Don't we have support for dumpling exidx in llvm-objdump? I was
>  surprised to not find it in Object/ELFTypes.h.

There is some support in llvm-readobj -u. Having given it a try it seems unreliable (segfaults frequently) when run on executables, and includes executables linked by .bfd and where gnu readelf -u has no problem with them. I've kept with the llvm-objdump -s for now, which also allows us to use fake .ARM.extab data that might also make llvm-readobj more prone to crash.


https://reviews.llvm.org/D40967





More information about the llvm-commits mailing list