
Using Max for both "PIC Level" and "PIE Level" is inconsistent. PIC imposes less restriction while PIE imposes more restriction. The result generally picks the more restrictive behavior: Min for PIC. This choice matches `ld -r`: a non-pic object and a pic object merge into a result which should be treated as non-pic. To allow linking "PIC Level" using Error/Max from old bitcode files, upgrade Error/Max to Min. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D130531
10 lines
285 B
LLVM
10 lines
285 B
LLVM
; RUN: llvm-link %s %p/Inputs/module-flags-pic-1-b.ll -S -o - | FileCheck %s
|
|
|
|
; test linking modules with specified and default PIC levels
|
|
|
|
!0 = !{ i32 7, !"PIC Level", i32 1 }
|
|
|
|
!llvm.module.flags = !{!0}
|
|
; CHECK: !llvm.module.flags = !{!0}
|
|
; CHECK: !0 = !{i32 8, !"PIC Level", i32 1}
|