MaskRay wrote:

When two globals specify the same explicit section but with different sectin 
properties, what's the suggested behavior?

```
; entsize differs -> calcUniqueIDUpdateFlagsAndSize bumps the ID, two foo 
sections, fine
@a = global i32 1, section "foo", !elf_section_properties !{i32 1879002126, i32 
4}
@b = global i32 2, section "foo", !elf_section_properties !{i32 1879002126, i32 
8}

; implicit sections -> the new `if (hasMetadata(...)) EmitUniqueSection = true;`
; forces unique IDs, so these get .text.a / .text.b and never collide
define void @a() !elf_section_properties !{i32 1879002126, i32 4} { ret void }
define void @b() !elf_section_properties !{i32 5,          i32 4} { ret void }
```

@efriedma-quic raised optimizer-interaction concerns that have been partly 
addressed (ConstantMerge was already safe, GlobalMerge was fixed in the 
follow-up #175875).

https://github.com/llvm/llvm-project/pull/149260
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to