[PATCH] Make global aliases have symbol size equal to their type

John Brawn john.brawn at arm.com
Tue Jun 30 07:31:32 PDT 2015


In http://reviews.llvm.org/D10837#197109, @rafael wrote:

> Why do you need to print the .size in the assembly? The assembler
>  itself (MC/gas) propagates the size.


Yes, but it propagates it from the aliasee. In global-merge-2.ll, for example, if you generate object output then inspect the symbol table it says

0000000000000000 g       .bss		 0000000c x
0000000000000004 g       .bss		 0000000c y
0000000000000008 g       .bss		 0000000c z

which says that x is 12-bytes in size starting at offset 8 inside the .bss section. As x was originally (before GlobalMerge) a 4-byte variable this is slightly surprising, plus the .bss section is 12 bytes long so z apparently extends past the end of the .bss section.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10837

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list