sync with OpenBSD -current

This commit is contained in:
purplerain 2024-01-12 01:27:06 +00:00
parent caf62be22c
commit b3ecf9fa9a
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
56 changed files with 383 additions and 289 deletions

View file

@ -2699,6 +2699,7 @@ in the instruction. */
BFD_RELOC_386_TLS_GOTDESC,
BFD_RELOC_386_TLS_DESC_CALL,
BFD_RELOC_386_TLS_DESC,
BFD_RELOC_386_GOT32X,
/* x86-64/elf relocations */
BFD_RELOC_X86_64_GOT32,

View file

@ -136,9 +136,14 @@ static reloc_howto_type elf_howto_table[]=
HOWTO(R_386_TLS_DESC, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_386_TLS_DESC",
TRUE, 0xffffffff, 0xffffffff, FALSE),
EMPTY_HOWTO (42), /* R_386_IRELATIVE */
HOWTO(R_386_GOT32X, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_386_GOT32X",
TRUE, 0xffffffff, 0xffffffff, FALSE),
/* Another gap. */
#define R_386_tls (R_386_TLS_DESC + 1 - R_386_tls_offset)
/* XXX R_386_GOT32X isn't really a TLS relocation */
#define R_386_tls (R_386_GOT32X + 1 - R_386_tls_offset)
#define R_386_vt_offset (R_386_GNU_VTINHERIT - R_386_tls)
/* GNU extension to record C++ vtable hierarchy. */
@ -314,6 +319,10 @@ elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
TRACE ("BFD_RELOC_386_TLS_DESC");
return &elf_howto_table[R_386_TLS_DESC - R_386_tls_offset];
case BFD_RELOC_386_GOT32X:
TRACE ("BFD_RELOC_386_GOT32X");
return &elf_howto_table[R_386_GOT32X - R_386_tls_offset];
case BFD_RELOC_VTABLE_INHERIT:
TRACE ("BFD_RELOC_VTABLE_INHERIT");
return &elf_howto_table[R_386_GNU_VTINHERIT - R_386_vt_offset];
@ -993,6 +1002,7 @@ elf_i386_check_relocs (bfd *abfd,
/* Fall through */
case R_386_GOT32:
case R_386_GOT32X:
case R_386_TLS_GD:
case R_386_TLS_GOTDESC:
case R_386_TLS_DESC_CALL:
@ -1004,6 +1014,7 @@ elf_i386_check_relocs (bfd *abfd,
{
default:
case R_386_GOT32: tls_type = GOT_NORMAL; break;
case R_386_GOT32X: tls_type = GOT_NORMAL; break;
case R_386_TLS_GD: tls_type = GOT_TLS_GD; break;
case R_386_TLS_GOTDESC:
case R_386_TLS_DESC_CALL:
@ -1392,6 +1403,7 @@ elf_i386_gc_sweep_hook (bfd *abfd,
case R_386_TLS_IE:
case R_386_TLS_GOTIE:
case R_386_GOT32:
case R_386_GOT32X:
if (h != NULL)
{
if (h->got.refcount > 0)
@ -2452,6 +2464,7 @@ elf_i386_relocate_section (bfd *output_bfd,
switch (r_type)
{
case R_386_GOT32:
case R_386_GOT32X:
/* Relocation is to the entry for this symbol in the global
offset table. */
if (htab->sgot == NULL)

View file

@ -1050,6 +1050,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_386_TLS_GOTDESC",
"BFD_RELOC_386_TLS_DESC_CALL",
"BFD_RELOC_386_TLS_DESC",
"BFD_RELOC_386_GOT32X",
"BFD_RELOC_X86_64_GOT32",
"BFD_RELOC_X86_64_PLT32",
"BFD_RELOC_X86_64_COPY",

View file

@ -1313,6 +1313,7 @@ tc_i386_fix_adjustable (fixP)
if (fixP->fx_r_type == BFD_RELOC_386_GOTOFF
|| fixP->fx_r_type == BFD_RELOC_386_PLT32
|| fixP->fx_r_type == BFD_RELOC_386_GOT32
|| fixP->fx_r_type == BFD_RELOC_386_GOT32X
|| fixP->fx_r_type == BFD_RELOC_386_TLS_GD
|| fixP->fx_r_type == BFD_RELOC_386_TLS_LDM
|| fixP->fx_r_type == BFD_RELOC_386_TLS_LDO_32
@ -5142,6 +5143,7 @@ md_apply_fix (fixP, valP, seg)
return;
case BFD_RELOC_386_GOT32:
case BFD_RELOC_386_GOT32X:
case BFD_RELOC_X86_64_GOT32:
value = 0; /* Fully resolved at runtime. No addend. */
break;
@ -5708,6 +5710,7 @@ tc_gen_reloc (section, fixp)
case BFD_RELOC_X86_64_GOTPCREL:
case BFD_RELOC_386_PLT32:
case BFD_RELOC_386_GOT32:
case BFD_RELOC_386_GOT32X:
case BFD_RELOC_386_GOTOFF:
case BFD_RELOC_386_GOTPC:
case BFD_RELOC_386_TLS_GD:

View file

@ -445,6 +445,7 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
|| (FIX)->fx_plt \
|| (FIX)->fx_r_type == BFD_RELOC_386_PLT32 \
|| (FIX)->fx_r_type == BFD_RELOC_386_GOT32 \
|| (FIX)->fx_r_type == BFD_RELOC_386_GOT32X \
|| (FIX)->fx_r_type == BFD_RELOC_386_GOTPC \
|| (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCREL \
|| TC_FORCE_RELOCATION (FIX))

View file

@ -66,6 +66,7 @@ START_RELOC_NUMBERS (elf_i386_reloc_type)
RELOC_NUMBER (R_386_TLS_GOTDESC, 39)
RELOC_NUMBER (R_386_TLS_DESC_CALL,40)
RELOC_NUMBER (R_386_TLS_DESC, 41)
RELOC_NUMBER (R_386_GOT32X, 43) /* 32 bit GOT entry */
/* Used by Intel. */
RELOC_NUMBER (R_386_USED_BY_INTEL_200, 200)