[PATCH] D117642: [XCOFF][llvm-objdump] ignore the default .text symbol during dissembling.
ChenZheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 19 21:11:24 PST 2022
shchenz added inline comments.
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1141
+ // for disassembly.
+ if (Obj->isXCOFF() && NameOrErr->equals(".text")) {
+ const SymbolRef::Type Type = unwrapOrError(Symbol.getType(), FileName);
----------------
Only handle `.text` is not enough I think. We can explicitly declare the section names in sthe ource code. For example:
```
int __attribute__((section ("explicit_sec"))) foo(int a)
{
return a;
}
int __attribute__((section ("explicit_sec2"))) foo1(int a)
{
return a;
}
int __attribute__((section ("explicit_sec"))) foo2(int a)
{
return a;
}
int __attribute__((section ("explicit_sec2"))) foo3(int a)
{
return a;
}
int foo4(int a)
{
return a;
}
int foo5(int a)
{
return a;
}
```
Your patch can fix the first function in `.text` section, but can not fix the first function in `explicit_sec2` or `explicit_sec`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117642/new/
https://reviews.llvm.org/D117642
More information about the llvm-commits
mailing list