Skip to content
Commit 0a2678e9 authored by Peter Collingbourne's avatar Peter Collingbourne
Browse files

ELF: --gdb-index: Change findSection to return an InputSection.

We should only ever expect this function to return a regular
InputSection; I would not expect a function definition to be in a
MergeInputSection or EhInputSection. We were previously crashing
in writeTo if this function returned a section that was not an
InputSection because we do not set OutSec for such sections.

This can happen in practice if a function is defined in an empty
section which shares its offset-in-file with a MergeInputSection,
as in the provided test case.

A better fix for this bug would be to fix the
DWARFUnit::collectAddressRanges() interface to provide section
information (see D33183), but this at least fixes the crash.

Differential Revision: https://reviews.llvm.org/D33176

llvm-svn: 303089
parent c5bee321
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment