This is an archive of the discontinued LLVM Phabricator instance.

Allow llvm-objdump to run on executable files
Needs ReviewPublic

Authored by ihalip on Sep 21 2019, 1:26 AM.

Details

Reviewers
echristo
compnerd
Summary

A kernel build step runs objdump -R vmlinux on the final executable. Using LLVM's objdump, this step spits out errors because:

$ llvm-objdump-10 -R vmlinux

vmlinux:        file format ELF64-ppc64

llvm-objdump-10: error: 'vmlinux': not a dynamic object

This change should allow objdump to be ran on executable files too.

Diff Detail

Event Timeline

ihalip created this revision.Sep 21 2019, 1:26 AM

Certainly missing a test.

AFAICT, there are no tests for objdump's -R option. It was added in https://reviews.llvm.org/D47493 (also clearly missing some tests).

Please post patches with context.

That said, I think that we should actually generalize this further. It should be permissible to dump the dynamic relocation table on any type of binary. It is acceptable to have nothing printed if there’re no entries.

Please post patches with context.

Probably could mention the Linux kernel in the commit message, and a link to:
https://github.com/ClangBuiltLinux/linux/issues/666 (nice)