[PATCH] D144872: [AIX] Align the content of an xcoff object file which has auxiliary header in big archive.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 00:43:30 PDT 2023


jhenderson added inline comments.


================
Comment at: llvm/test/Object/archive-malformed-object.test:16
+# RUN: rm -rf bad.a
+# RUN: not llvm-ar rcS bad.a xcoff.o input.bc 2>&1 | FileCheck %s --check-prefix=ERR1
+
----------------
DiggerLin wrote:
> jhenderson wrote:
> > I'm pretty sure you don't want the `S` here? Compare this command to the one above. If you are using a non-big archive format (which will be the default on many people's systems), then the symbols are only loaded if `S` is not present. If the symbols aren't loaded, the bitcode file won't result in an error (I think).
>  I need to `S` to test your comment ,  the archive format always depend on the first object file of llvm-ar argument(no matter the OS). when the xcoff object file, the archive is big archive.
>   
> `Ideally, you would also have a test case that shows that when no symbols are requested (i.e. llvm-ar S<more options> test.a xcoff.o), an error is also reported for an invalid member of a big archive.`
Oh, okay I misremembered how the format selection works. Using `--format=bigarchive` is probably a good idea anyway for clarity.

My expectation with the suggestion you've quoted was that `xcoff.o` would be the file that couldn't be read, rather than your test case mixing bitcode and xcoff files. I think mixing formats might be a little bit confusing, so I'd either have one/two xcoff files (so the same pair of cases as the invalid bitcode with symbol table cases above, but using xcoff files), or even just the same as the previous two cases, but with `S` (and the `--format=bigarchive` option), using the same bitcode files. I have no particular preference (but it probably is a good idea to include both "first" and "not first" cases for completeness).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144872/new/

https://reviews.llvm.org/D144872



More information about the llvm-commits mailing list