[PATCH] D87403: [ms] [llvm-ml] Add support for "alias" directive

Eric Astor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 13:20:55 PDT 2020


epastor marked an inline comment as done.
epastor added inline comments.


================
Comment at: llvm/test/tools/llvm-ml/alias.test:15
+
+alias <t3> = <t1>
+; CHECK: (scl 69){{.*}}t3
----------------
epastor wrote:
> thakis wrote:
> > What happens if you do `alias <t5> = <t3>` (ie an alias to an alias)?
> Interesting. Using ml64.exe and `alias <t7> = <t4>`, you get an alias to an alias:
> ```
> 008 00000000 SECT1  notype ()    External     | t2
> 009 00000000 UNDEF  notype       WeakExternal | t4
>     Default index        8 Alias record
> 00B 00000000 UNDEF  notype       WeakExternal | t7
>     Default index        9 Alias record
> ```
> 
> Using llvm-ml, you currently get a second weak default-null reference pointing directly to t2:
> ```
> [ 3](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x00000001 t2
> ...
> [ 7](sec  0)(fl 0x00)(ty   0)(scl  69) (nx 1) 0x00000000 t4
> AUX indx 9 srch 3
> [ 9](sec  1)(fl 0x00)(ty   0)(scl  69) (nx 0) 0x00000001 .weak.t4.default.t1
> ...
> [17](sec  0)(fl 0x00)(ty   0)(scl  69) (nx 1) 0x00000000 t7
> AUX indx 19 srch 3
> [19](sec  1)(fl 0x00)(ty   0)(scl  69) (nx 0) 0x00000001 .weak.t7.default.t1
> ```
> 
> These will both alias back to `t2`, but it's unclear what the effects of this deviation are. What do the .weak .default symbols actually do? Can we guarantee these are equivalent?
D88305 resolved this by letting aliases for external symbols point directly to their targets. I've gone ahead and updated these tests to fix that - and also switched them over to llvm-readobj while I was at it, since it involves significantly less regex-hacking to make them match correctly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87403



More information about the llvm-commits mailing list