case R_LARCH_TLS_DTPREL32:
case R_LARCH_TLS_DTPREL64:
- if (resolved_dynly)
- {
- Elf_Internal_Rela outrel;
-
- outrel.r_offset = _bfd_elf_section_offset (info->output_bfd, info,
- input_section,
- rel->r_offset);
- unresolved_reloc = (!((bfd_vma) -2 <= outrel.r_offset)
- && (input_section->flags & SEC_ALLOC));
- outrel.r_info = ELFNN_R_INFO (h->dynindx, r_type);
- outrel.r_offset += sec_addr (input_section);
- outrel.r_addend = rel->r_addend;
- if (unresolved_reloc)
- loongarch_elf_append_rela (info->output_bfd, sreloc, &outrel);
- break;
- }
-
- if (resolved_to_const)
- fatal = loongarch_reloc_is_fatal (info, input_bfd, input_section,
- rel, howto,
- bfd_reloc_notsupported,
- is_undefweak, name,
- "Internal:");
- if (resolved_local)
- {
- if (!elf_hash_table (info)->tls_sec)
- {
- fatal = loongarch_reloc_is_fatal (info, input_bfd,
- input_section, rel, howto, bfd_reloc_notsupported,
- is_undefweak, name, "TLS section not be created");
- }
- else
- relocation = tlsoff (info, relocation);
- }
- else
- {
- fatal = loongarch_reloc_is_fatal (info, input_bfd,
- input_section, rel, howto, bfd_reloc_undefined,
- is_undefweak, name,
- "TLS LE just can be resolved local only.");
- }
-
+ /* GCC version <= 16.1 output extra addend 0x8000 in
+ loongarch_output_dwarf_dtprel. Add the addend here
+ wuold cause problems for TLS debug info. */
+ relocation = tlsoff (info, relocation);
+ unresolved_reloc = false;
break;
case R_LARCH_SOP_PUSH_TLS_TPREL:
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_LARCH_TLS_DTPREL32", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0, /* src_mask */
ALL_ONES, /* dst_mask */
false, /* pcrel_offset */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_LARCH_TLS_DTPREL64", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0, /* src_mask */
ALL_ONES, /* dst_mask */
false, /* pcrel_offset */
--- /dev/null
+#ld: -e0
+#objdump: -D -j .debug_info
+
+#...
+0* <.debug_info>:
+ 0: 00000008 .word 0x00000008
+ 4: 00000008 .word 0x00000008
+ 8: 00000008 .word 0x00000008
+ c: 00000000 .word 0x00000000
+ 10: 00000008 .word 0x00000008
+ 14: 00000000 .word 0x00000000