[PATCH] D98323: [lld-macho] implement options -map

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 12:24:24 PDT 2021


int3 added a comment.

almost there!



================
Comment at: lld/test/MachO/map-file.s:6
+
+# RUN: %lld -map=%t.map %t/test.o %t/foo.o -o %t/test-map
+# RUN: FileCheck -match-full-lines -strict-whitespace %s < %t.map
----------------
int3 wrote:
> The test seems to be failing, I guess it should be a `-map` without the `=`?
> 
> also I think it would be nicer to have the output go to `%t/map`
could you move the other files under `%t/` as well, i.e. `%t/foo.o` and `%t/test.o`?


================
Comment at: lld/test/MachO/map-file.s:28-29
+# CHECK-NEXT: # Address  Size      Segment  Section
+# CHECK-NEXT: 0x100000308  0x00000001  __TEXT  __text
+# CHECK-NEXT: 0x100000309  0x00000000  __TEXT  obj
+# CHECK-NEXT: # Symbols:
----------------
int3 wrote:
> We try not to match against hardcoded addresses because they're a bit of a pain to update. In this case I think it would be better to match this against `llvm-objdump`'s output: something like
> 
> ```
> RUN: llvm-objdump --syms --section-headers %t/test-map > %t/objdump
> RUN: cat %t/objdump %t/map > %t/out
> RUN: FileCheck %s < %t/out
> ```
> 
> Then we can use [[ https://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-numeric-substitution-blocks | numeric substitutions ]] to check that the values line up.
this still needs to be addressed


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98323



More information about the llvm-commits mailing list