if (C != 0)
return true;
+ // gold<2.34 incorrectly ignored the addend for R_386_GOTOFF (9)
+ // (http://sourceware.org/PR16794).
+ if (TargetObjectWriter->getEMachine() == ELF::EM_386 &&
+ Type == ELF::R_386_GOTOFF)
+ return true;
+
// ld.lld handles R_MIPS_HI16/R_MIPS_LO16 separately, not as a whole, so
// it doesn't know that an R_MIPS_HI16 with implicit addend 1 and an
// R_MIPS_LO16 with implicit addend -32768 represents 32768, which is in
// CHECK-NEXT: Section {{.*}} .rel.text {
/// Do not use STT_SECTION symbol for R_386_GOTOFF to work around a gold<2.34 bug
/// https://sourceware.org/bugzilla/show_bug.cgi?id=16794
-// I386-NEXT: 0x2 R_386_GOTOFF .rodata.str1.1
+// I386-NEXT: 0x2 R_386_GOTOFF .Lfoo
// IAMCU-NEXT: 0x2 R_386_GOTOFF .rodata.str1.1
// CHECK-NEXT: 0x{{[^ ]+}} R_386_PLT32 bar2
// CHECK-NEXT: 0x{{[^ ]+}} R_386_GOTPC _GLOBAL_OFFSET_TABLE_