[PATCH] D140202: [lld][ARM][2/3]Big Endian support - Word invariant support

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 12:10:59 PDT 2023


peter.smith added a comment.

A few small comments to move an error message to Driver.cpp and to remove the `--be32` option. This will mean updating the tests.

I've not had the chance to check through the tests yet, but will do so tomorrow.

Please can you Commandeer https://reviews.llvm.org/D140203 and take the `Abandon Revision` action. That revision is now redundant as this one includes all of its changes and tests.



================
Comment at: lld/ELF/ARMErrataFix.cpp:181
+  if (config->be32)
+    error("Unsupported for big-endian");
   if (isARM)
----------------
This comment still needs to be done. I've left a comment to highlight the place in Driver.cpp


================
Comment at: lld/ELF/Driver.cpp:347
 
   if (config->fixCortexA8 && config->emachine != EM_ARM)
     error("--fix-cortex-a8 is only supported on ARM targets");
----------------
This would be the place to move the check from ARMErrataFix.cpp.

Message text could be something like `--fix-cortex-a8 is not supported on big-endian targets`

I also suggest adding an error message for --be32 on emachine != EM_ARM


================
Comment at: lld/ELF/Options.td:41
+
 def Bno_symbolic: F<"Bno-symbolic">, HelpText<"Don't bind default visibility defined symbols locally for -shared (default)">;
 
----------------
These comments not done yet.

GNU ld only has the `--be8` option, it defaults to `--be32`. We should remove this command line from upstream and default to `--be32` (tests will need altering).

When the `--be8` support is added we can add the `--be8` switch.

The `--be8` is in theory the better default, but if we do go down that route we will need both `--be8` and `--be32` as GCC and clang drivers will always pass `--be8`.


================
Comment at: lld/docs/ld.lld.1:91
 .Fl shared.
+.It Fl --be32
+Specifies legacy Word Invariant Addressing big-endian mode, that is, identical to big-endian images prior to ARMv6. This produces big-endian code and data.
----------------
I think we should take this out given that I'm suggesting taking out `--be32` to match the GNU ld interface.

When we add `--be8` we'll need to add that here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140202



More information about the llvm-commits mailing list