Compare commits
10 commits
fdef3910ed
...
bb9a0a36e7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bb9a0a36e7 | ||
![]() |
e17aa8bbd8 | ||
![]() |
2c1975500d | ||
![]() |
a8563dba75 | ||
![]() |
e2d776f7b9 | ||
![]() |
0cdfcb9b8c | ||
![]() |
923497873f | ||
![]() |
551c1430e5 | ||
![]() |
b194ae062e | ||
![]() |
33990e5ced |
2 changed files with 29 additions and 23 deletions
|
@ -5325,8 +5325,8 @@ loongarch_elf_relax_section (bfd *abfd, asection *sec,
|
||||||
for (unsigned int i = 0; i < sec->reloc_count; i++)
|
for (unsigned int i = 0; i < sec->reloc_count; i++)
|
||||||
{
|
{
|
||||||
char symtype;
|
char symtype;
|
||||||
bfd_vma symval;
|
bfd_vma symval = 0; /* "= 0" for https://gcc.gnu.org/PR118216 */
|
||||||
asection *sym_sec;
|
asection *sym_sec = NULL;
|
||||||
bool local_got = false;
|
bool local_got = false;
|
||||||
Elf_Internal_Rela *rel = relocs + i;
|
Elf_Internal_Rela *rel = relocs + i;
|
||||||
struct elf_link_hash_entry *h = NULL;
|
struct elf_link_hash_entry *h = NULL;
|
||||||
|
@ -5410,6 +5410,11 @@ loongarch_elf_relax_section (bfd *abfd, asection *sec,
|
||||||
&& GOT_TLS_GD_BOTH_P (tls_type))
|
&& GOT_TLS_GD_BOTH_P (tls_type))
|
||||||
symval += 2 * GOT_ENTRY_SIZE;
|
symval += 2 * GOT_ENTRY_SIZE;
|
||||||
}
|
}
|
||||||
|
else if (h->plt.offset != MINUS_ONE)
|
||||||
|
{
|
||||||
|
sym_sec = htab->elf.splt ? htab->elf.splt : htab->elf.iplt;
|
||||||
|
symval = h->plt.offset;
|
||||||
|
}
|
||||||
else if ((h->root.type == bfd_link_hash_defined
|
else if ((h->root.type == bfd_link_hash_defined
|
||||||
|| h->root.type == bfd_link_hash_defweak)
|
|| h->root.type == bfd_link_hash_defweak)
|
||||||
&& h->root.u.def.section != NULL
|
&& h->root.u.def.section != NULL
|
||||||
|
@ -5418,14 +5423,33 @@ loongarch_elf_relax_section (bfd *abfd, asection *sec,
|
||||||
symval = h->root.u.def.value;
|
symval = h->root.u.def.value;
|
||||||
sym_sec = h->root.u.def.section;
|
sym_sec = h->root.u.def.section;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (h && LARCH_REF_LOCAL (info, h))
|
if (h && LARCH_REF_LOCAL (info, h))
|
||||||
local_got = true;
|
local_got = true;
|
||||||
symtype = h->type;
|
symtype = h->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the conditions for tls type transition are met, type
|
||||||
|
transition is performed instead of relax.
|
||||||
|
During the transition from DESC->IE/LE, there are 2 situations
|
||||||
|
depending on the different configurations of the relax/norelax
|
||||||
|
option.
|
||||||
|
If the -relax option is used, the extra nops will be removed,
|
||||||
|
and this transition is performed in pass 0.
|
||||||
|
If the --no-relax option is used, nop will be retained, and
|
||||||
|
this transition is performed in pass 1. */
|
||||||
|
if (IS_LOONGARCH_TLS_TRANS_RELOC (r_type)
|
||||||
|
&& (i + 1 != sec->reloc_count)
|
||||||
|
&& ELFNN_R_TYPE (rel[1].r_info) == R_LARCH_RELAX
|
||||||
|
&& loongarch_can_trans_tls (abfd, info, h, r_symndx, r_type))
|
||||||
|
{
|
||||||
|
loongarch_tls_perform_trans (abfd, sec, rel, h, info);
|
||||||
|
r_type = ELFNN_R_TYPE (rel->r_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sym_sec)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (sym_sec->sec_info_type == SEC_INFO_TYPE_MERGE
|
if (sym_sec->sec_info_type == SEC_INFO_TYPE_MERGE
|
||||||
&& (sym_sec->flags & SEC_MERGE))
|
&& (sym_sec->flags & SEC_MERGE))
|
||||||
{
|
{
|
||||||
|
@ -5453,24 +5477,6 @@ loongarch_elf_relax_section (bfd *abfd, asection *sec,
|
||||||
|
|
||||||
symval += sec_addr (sym_sec);
|
symval += sec_addr (sym_sec);
|
||||||
|
|
||||||
/* If the conditions for tls type transition are met, type
|
|
||||||
transition is performed instead of relax.
|
|
||||||
During the transition from DESC->IE/LE, there are 2 situations
|
|
||||||
depending on the different configurations of the relax/norelax
|
|
||||||
option.
|
|
||||||
If the -relax option is used, the extra nops will be removed,
|
|
||||||
and this transition is performed in pass 0.
|
|
||||||
If the --no-relax option is used, nop will be retained, and
|
|
||||||
this transition is performed in pass 1. */
|
|
||||||
if (IS_LOONGARCH_TLS_TRANS_RELOC (r_type)
|
|
||||||
&& (i + 1 != sec->reloc_count)
|
|
||||||
&& ELFNN_R_TYPE (rel[1].r_info) == R_LARCH_RELAX
|
|
||||||
&& loongarch_can_trans_tls (abfd, info, h, r_symndx, r_type))
|
|
||||||
{
|
|
||||||
loongarch_tls_perform_trans (abfd, sec, rel, h, info);
|
|
||||||
r_type = ELFNN_R_TYPE (rel->r_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (r_type)
|
switch (r_type)
|
||||||
{
|
{
|
||||||
case R_LARCH_ALIGN:
|
case R_LARCH_ALIGN:
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
In releases, the date is not included in either version strings or
|
In releases, the date is not included in either version strings or
|
||||||
sonames. */
|
sonames. */
|
||||||
#define BFD_VERSION_DATE 20241222
|
#define BFD_VERSION_DATE 20241230
|
||||||
#define BFD_VERSION @bfd_version@
|
#define BFD_VERSION @bfd_version@
|
||||||
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
|
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
|
||||||
#define REPORT_BUGS_TO @report_bugs_to@
|
#define REPORT_BUGS_TO @report_bugs_to@
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue