This is an archive of the discontinued LLVM Phabricator instance.

Fix crash in llvm-objdump with proc-specific sections
ClosedPublic

Authored by colinl on Feb 17 2015, 2:33 PM.

Details

Summary

getSection returns nullptr for some section types:

if (symb->st_shndx >= ELF::SHN_LORESERVE)
  return nullptr;

but getSymbolAddress was dereferencing this without checking.

Diff Detail

Repository
rL LLVM

Event Timeline

colinl updated this revision to Diff 20109.Feb 17 2015, 2:33 PM
colinl retitled this revision from to Fix crash in llvm-objdump with proc-specific sections.
colinl updated this object.
colinl edited the test plan for this revision. (Show Details)
colinl set the repository for this revision to rL LLVM.
colinl added a subscriber: Unknown Object (MLST).

Can we use yaml2obj in the test ?

That seems like a possibility. I've never written one before so I'll have to figure out how. As long as they can generate process-specific elf sections it should be possible.

rafael accepted this revision.Feb 18 2015, 2:15 PM
rafael edited edge metadata.

Checking in binaries is fine.

include/llvm/Object/ELFObjectFile.h
318

Style: Don't use auto in here.

This revision is now accepted and ready to land.Feb 18 2015, 2:15 PM
colinl closed this revision.Feb 18 2015, 3:03 PM

Changed auto to the full type.
Kept binary file as small as possible, 800 bytes.