D132262 tried to simplify IsMetadataOrEHFrameSection originally introduced in
D127549 but caused a regression as .quad directives in
.section .note,"a",@note; note: .quad extern-note # extern is undefined .section .rodata,"a",@progbits; rodata: .quad extern-rodata # extern is undefined .section .nonalloc,"",@progbits; nw: .quad extern-nw
are incorrectly rejected: these differences may be link-time constants and
are allowed in GNU assembler and LLVM MC's non-RISC-V ports.
Relax the conditions to allow these cases. For A-B, A may be defined later, but
this requiresFixups call has to eagerly make a decision. For now, emit ADD/SUB
unless A is .L*. This euristic handles many temporary label differences for
.debug_* and .apple_types sections. Ideally we should delay the decision of
PC-relative vs ADD/SUB until A is defined.
This really seems like the original cases were correct but need to be augmented further to handle data sections. If there is a cross-section textual reference, that should generate the relocation pair. The data section is interesting because the .eh_frame, .apple_names, .apple_types, and .debug_* do not want the pairwise relocation. Adjusting this to handle it that way would not only fix this, but also likely fix the cases of fission that we currently fail on.