8 Commits

Author SHA1 Message Date
Digger Lin
5ab2259bcf [XCOFF]implement parsing relocation information for 32-bit xcoff object file
Summary:
    Parsing the relocation entry information for 32-bit xcoff object file
including deal with the relocation overflow.

Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue.

Subscribers: hiraditya, rupprecht, seiya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374946 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 20:42:11 +00:00
Digger Lin
382c1a971c [llvm-readobj][xcoff] implement parsing overflow section header.
SUMMARY:
in the xcoff, if the number of relocation entries or line number entries is
overflow(large than or equal 65535) , there will be overflow section for it.
The interpret of overflow section is different with generic section header,
the patch implement parsing the overflow section.

Reviewers: hubert.reinterpretcast,sfertile,jasonliu
Subscribers: rupprecht, seiya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374941 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 19:28:11 +00:00
Jason Liu
68040127a3 [AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to SectionOrLength.
Summary:
According the the XCOFF document,
If
Then
XTY_SD
x_scnlen contains the csect length.
XTY_LD
x_scnlen contains the symbol table index of the containing csect.
XTY_CM
x_scnlen contains the csect length.
XTY_ER
x_scnlen contains 0.

Change the SectionLen member name to SectionOrLength is more reasonable.

Authored By: DiggerLin

Reviewed By: hubert.reinterpretcast

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374179 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 16:19:39 +00:00
Jason Liu
0575f5892a [llvm-readobj][XCOFF][NFC] Add return statement to avoid -Wimplicit-fallthrough warning
This is to fix the commit in r370097.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370260 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 20:59:17 +00:00
Jason Liu
8a49f34066 [XCOFF][AIX] Generate symbol table entries with llvm-readobj
Summary:

This patch implements main entry and auxiliary entries of symbol table generation for llvm-readobj on AIX.
The source code of aix_xcoff_xlc_test8.o (compile with xlc) is:

-bash-4.2$ cat test8.c
extern int i;
extern int TestforXcoff;
extern int fun(int i);
static int static_i;
char* p="abcd";
int fun1(int j) {
  static_i++;
  j++;
  j=j+*p;
  return j;
}
int main() {
  i++;
  fun(i);
  return fun1(i);
}

Patch provided by DiggerLin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370097 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 18:54:46 +00:00
Sean Fertile
785cf2e4b7 [Object][XCOFF] Add support for 64-bit file header and section header dumping.
Adds a readobj dumper for 32-bit and 64-bit section header tables, and extend
support for the file-header dumping to include 64-bit object files. Also
refactors the binary file parsing to be done in a helper function in an attempt
to cleanup error handeling.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365524 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-09 18:09:11 +00:00
Jason Liu
76ee591e56 [XCOFF] Implement parsing symbol table for xcoffobjfile and output as yaml format
Summary:
This patch implement parsing symbol table for xcoffobjfile and
output as yaml format. Parsing auxiliary entries of a symbol
will be in a separate patch.

The XCOFF object file (aix_xcoff.o) used in the test comes from
-bash-4.2$ cat test.c
extern int i;
extern int TestforXcoff;
int main()
{
i++;
TestforXcoff--;
}

Patch by DiggerLin

Reviewers: sfertile, hubert.reinterpretcast, MaskRay, daltenty

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361832 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 14:37:59 +00:00
Sean Fertile
c0bc443a7f [Object][XCOFF] Add an XCOFF dumper for llvm-readobj.
Patch adds support for dumping of file headers with llvm-readobj. XCOFF
object files are added to test dumping a well formed file, and dumping
both negative timestamps and negative symbol counts, both of which are
allowed in the XCOFF definition.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359878 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 12:57:07 +00:00