Discussion:
[PATCH 0/3] PR ld/21375: MIPS: Fix non-zero run-time value for undefined weaks
Maciej W. Rozycki
2018-07-17 17:48:33 UTC
Permalink
Hi,

This patch series addresses the MIPS backend issue observed with PR
ld/21375 where undefined hidden and internal weak symbols have a non-zero
run-time value in shared libraries and PIE executables in references that
go via the GOT (i.e. code rather than data references). This is because
GOT entries associated with such symbols are assigned to the local part of
the GOT, which at load time is implicitly relocated by the base address.
Data references are unaffected because the relevant R_MIPS_32 or R_MIPS_64
relocation is fully resolved (to 0) at link time.

The issue does not currently trigger in PIE executables for undefined
weak symbols that have the default or protected export class, because we
always export such symbols, due to problems with `--no-export-dynamic'
(covered by PR ld/21805) and `-z nodynamic-undefined-weak' options. This
issue does not trigger in regular executables, because the value of 0
stored in the GOT entry referred by the static linker does not change at
load time.

Three patches are included, a preparatory change to factor out a piece of
code that now will be used in a few places rather than just one, the
actual fix for PR ld/21375 with the necessary adjustments to the test
suite and a set of new test cases to cover various link scenarios the
updated code has to work with, split off due to their size. See
individual change descriptions for further details.

This has been regression-tested with my usual MIPS targets. I will leave
these changes waiting for 24 hours before I commit them, and will be happy
to accept feedback during that time.

Maciej
Maciej W. Rozycki
2018-07-17 17:49:19 UTC
Permalink
Move code used to store the contents of a relocated field in output into
a separate function, `mips_elf_store_contents', complementing existing
`mips_elf_obtain_contents'.

bfd/
* elfxx-mips.c (mips_elf_store_contents): New function...
(mips_elf_perform_relocation): ... factored out from here.
---
bfd/elfxx-mips.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)

binutils-mips-bfd-store-contents.diff
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c 2018-07-13 02:34:04.696654752 +0100
+++ binutils/bfd/elfxx-mips.c 2018-07-13 02:34:10.938762490 +0100
@@ -5234,6 +5234,21 @@ mips_elf_relocation_needs_la25_stub (bfd
}
}

+/* Store the field relocated by RELOCATION. */
+
+static void
+mips_elf_store_contents (reloc_howto_type *howto,
+ const Elf_Internal_Rela *relocation,
+ bfd *input_bfd, bfd_byte *contents, bfd_vma x)
+{
+ bfd_byte *location = contents + relocation->r_offset;
+ unsigned int size = bfd_get_reloc_size (howto);
+
+ /* Put the value into the output. */
+ if (size != 0)
+ bfd_put (8 * size, input_bfd, x, location);
+}
+
/* Calculate the value produced by the RELOCATION (which comes from
the INPUT_BFD). The ADDEND is the addend to use for this
RELOCATION; RELOCATION->R_ADDEND is ignored.
@@ -6346,7 +6361,6 @@ mips_elf_perform_relocation (struct bfd_
bfd_vma x;
bfd_byte *location;
int r_type = ELF_R_TYPE (input_bfd, relocation->r_info);
- unsigned int size;

/* Figure out where the relocation is occurring. */
location = contents + relocation->r_offset;
@@ -6505,9 +6519,7 @@ mips_elf_perform_relocation (struct bfd_
}

/* Put the value into the output. */
- size = bfd_get_reloc_size (howto);
- if (size != 0)
- bfd_put (8 * size, input_bfd, x, location);
+ mips_elf_store_contents (howto, relocation, input_bfd, contents, x);

_bfd_mips_elf_reloc_shuffle (input_bfd, r_type, !bfd_link_relocatable (info),
location);
Maciej W. Rozycki
2018-07-17 17:50:19 UTC
Permalink
We have an issue in the MIPS backend, with the handling of undefined
hidden and internal weak symbols. References to such symbols are
supposed to resolve to 0 according to the ELF gABI[1]:

"Unresolved weak symbols have a zero value."

and the 64-bit MIPS psABI[2]:

"If a symbol with one of these [hidden or internal] attributes has no
definition within the executable/DSO being linked, then it must be
resolved to allocated space if common, resolved to zero if weak, or an
error reported otherwise."

however if a GOT relocation is used, then a local GOT entry is created
and used to satisfy the reference. Such an entry is then (in DSO and
PIE binaries) subject to the usual load-time relocation, which means a
non-zero value will be returned if the base address is non-zero. This
will defeat the usual run-time sequence like:

void a (void) __attribute__ ((visibility ("hidden"), weak));

void
x (void)
{
if (a)
a ();
}

This can be reproduced with this simple code:

$ cat libtest.c
extern int a __attribute__ ((visibility ("hidden"), weak));

int *
x (void)
{
return &a;
}
$ cat test.c
#include <stdio.h>

int *x (void);

int
main (void)
{
printf ("a: %p\n", x ());

return 0;
}
$ gcc -shared -fPIC -o libtest.so libtest.c
$ gcc -o test test.c -Wl,-rpath,$(pwd) libtest.so
$ ./test
a: 0x77184000
$

The usual approach targets take is making all the steps required to
assign a GOT entry for the symbol referred, and then leave its contents
at zero with no dynamic relocation attached, therefore ensuring that the
value does not change at load time. However this is not going to work
with the implicitly relocated GOT the MIPS psABI specifies[3]:

"The dynamic linker relocates the global offset table by first adding
the difference between the base where the shared object is loaded and
the value of the dynamic tag DT_MIPS_BASE_ADDRESS to all local global
offset table entries."

and we cannot therefore use the local GOT part.

And we cannot offhand use the global part either, as the symbol would
then have to be exported and possibly wrongly preempt symbols in other
modules involved in the dynamic load, because as per the ELF gABI[1] we
are not allowed to enter a hidden or internal symbol into the dynamic
symbol table (and then use its associated GOT entry):

"A hidden symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."

and:

"An internal symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."

So we have to choose something else.

Our choice is further limited by the need for the reference associated
with the GOT relocation to stay within the signed 16-bit limit from the
GOT pointer base register, while being compliant with the ELF gABI and
the MIPS psABI. However as Alan Modra has observed[4] one possibility
is to edit (relax) the code such that the GOT reference is removed
altogether.

Based on these observations then modify MIPS BFD linker backend code to:

1. Interpret code associated with GOT relocations and relax the usual LW
or LD instructions into a corresponding immediate load operation that
places the value of 0 in the intended register, while leaving the GOT
entry allocated and initialized as usually.

2. Leave any other instructions associated with GOT relocations in place
and instead redirect the reference to a global GOT entry associated
with a special `__gnu_absolute_zero' symbol created for this purpose,
whose value is 0, SHN_ABS section marks it absolute, binding is
global and export class protected, ensuring that the locally provided
value is always used at load time, and that the value is not
relocated by the dynamic loader.

3. Adjust any high-part GOT relocation used, typically associated with
a LUI instruction, accordingly, so that run-time consistency is
maintained, either by resolving to the original entry if the
instruction associated with the corresponding low-part GOT relocation
has been relaxed to an immediate load (in which case the value loaded
with LUI will be overwritten), or by also redirecting the reference
to `__gnu_absolute_zero' to complete the GOT access sequence if that
symbol has been used.

4. Add a target `elf_backend_hide_symbol' hook, for the three MIPS ABIs,
which prevents the `__gnu_absolute_zero' symbol from being forced
local, to ensure that the redirection works and the symbol remains
global/protected with existing linker scripts unchanged.

5. Observing the issue with handling SHN_ABS symbols in the GNU dynamic
loader, covered by glibc PR 19818, set the EI_ABIVERSION field in the
ELF file header produced to 4 (ABI_ABSOLUTE) if `__gnu_absolute_zero'
symbol has been produced and the target configured indicates the GNU
operating system, so that broken versions of the GNU dynamic loader
gracefully reject the file in loading rather than going astray. Keep
EI_ABIVERSION at the original value for other operating systems or if
no `__gnu_absolute_zero' symbol has been made.

The name of the special `__gnu_absolute_zero' has no meaning other than
how a human reader can interpret it, as it is ignored in dynamic loading
in the handling of the scenarios concerned. This is because the symbol
resolves locally, and it's only the symbol's attributes that matter so
that the associated GOT entry remains unchanged at load time.

Therefore the name is somewhat arbitrary, observing however the need to
use the name space reserved for the system so that it does not conflict
with a possible user symbol, and hence the leading underscore, and also
the `gnu' infix to denote a GNU feature. Other implementations wishing
to address the problem in a similar way may choose a different name and
have the solution still work, possibly with a mixture of modules used in
a dynamic having symbols of different names provided, which will however
not interact with each other due to the protected export class.

The symbol can be referred explicitly, however the name is an internal
implementation detail rather than a part of the ABI, and therefore no
specific semantics is guaranteed.

One limitation of this change is that if `__gnu_absolute_zero' has been
already defined, then we do not wipe the old definition and all kinds of
odd behavior can result. This is however like with other symbols we
internally define, such as `_GLOBAL_OFFSET_TABLE_' or `__rld_map', and
therefore left as a possible future enhancement.

As an optimization the relaxation of LW and LD instructions to a load of
immediate zero is always made, even SVR4 PIC code for code that will end
up in a regular (non-PIE) executable, because there is a cache advantage
with the avoidance of a load from the GOT, even if it is otherwise
guaranteed to remain zero. It does not reliably happen though, due to a
symbol exportation issue affecting executables, covered by PR ld/21805.

One existing test case needs to be updated, as it triggers relaxation
introduced with this change and consequently linker output does not
match expectations anymore. As we want to keep the original issue
covered with the test case modify it then to use the LWL instruction in
place of LW, and adjust the output expected accordingly.

References:

[1] "System V Application Binary Interface - DRAFT - 19 October 2010",
The SCO Group, Section "Symbol Table",
<http://www.sco.com/developers/gabi/2012-12-31/ch4.symtab.html>

[2] "64-bit ELF Object File Specification, Draft Version 2.5", MIPS
Technologies / Silicon Graphics Computer Systems, Order Number
007-4658-001, Section 2.5 "Symbol Table", p. 22,
<http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf>

[3] "SYSTEM V APPLICATION BINARY INTERFACE, MIPS RISC Processor
Supplement, 3rd Edition", Section "Global Offset Table", p. 5-10,
<http://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf>

[4] "Undo dynamic symbol state after regular object sym type mismatch",
<https://sourceware.org/ml/binutils/2017-07/msg00265.html>

bfd/
PR ld/21375
* elfxx-mips.h (_bfd_mips_elf_hide_symbol): New prototype.
(_bfd_mips_elf_linker_flags): Update prototype.
* elf32-mips.c (elf_backend_hide_symbol): New macro.
* elf64-mips.c (elf_backend_hide_symbol): Likewise.
* elfn32-mips.c (elf_backend_hide_symbol): Likewise.
* elfxx-mips.c (mips_elf_link_hash_table): Add
`use_absolute_zero' and `gnu_target' members.
(mips_elf_record_global_got_symbol): Call
`_bfd_mips_elf_hide_symbol' rather than
`_bfd_elf_link_hash_hide_symbol'.
(mips_use_local_got_p): Return FALSE if the symbol is absolute.
(mips_elf_obtain_contents): Reorder function.
(mips_elf_nullify_got_load): New function.
(mips_elf_calculate_relocation): Add `contents' parameter.
Nullify GOT loads or if it is not possible, then redirect GOT
relocations to the `__gnu_absolute_zero' symbol, for references
that are supposed to resolve to zero.
(mips_elf_define_absolute_zero): New function.
(_bfd_mips_elf_check_relocs): Prepare for arrangements made in
`mips_elf_calculate_relocation' for references made via the GOT
that are supposed to resolve to zero.
(_bfd_mips_elf_hide_symbol): New function.
(_bfd_mips_elf_linker_flags): Add the `gnu_target' parameter,
set the `gnu_target' member of the MIPS hash table.
(MIPS_LIBC_ABI_ABSOLUTE): New enumeration constant.
(_bfd_mips_post_process_headers): Use it.

ld/
PR ld/21375
* emultempl/mipself.em: Set `gnu_target' according to ${target}.
(mips_create_output_section_statements): Update call to
`_bfd_mips_elf_linker_flags'.
* testsuite/ld-mips-elf/pr21334.s: Use LWL rather than LW.
* testsuite/ld-mips-elf/pr21334.dd: Update accordingly.
---
bfd/elf32-mips.c | 1
bfd/elf64-mips.c | 1
bfd/elfn32-mips.c | 1
bfd/elfxx-mips.c | 276 ++++++++++++++++++++++++++++++------
bfd/elfxx-mips.h | 4
ld/emultempl/mipself.em | 12 +
ld/testsuite/ld-mips-elf/pr21334.dd | 2
ld/testsuite/ld-mips-elf/pr21334.s | 2
8 files changed, 254 insertions(+), 45 deletions(-)

binutils-mips-bfd-exec-undefweak-got.diff
Index: binutils/bfd/elf32-mips.c
===================================================================
--- binutils.orig/bfd/elf32-mips.c 2018-07-16 03:27:55.718929237 +0100
+++ binutils/bfd/elf32-mips.c 2018-07-16 03:28:00.000000000 +0100
@@ -2534,6 +2534,7 @@ static const struct ecoff_debug_swap mip
#define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook
#define elf_backend_copy_indirect_symbol \
_bfd_mips_elf_copy_indirect_symbol
+#define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol
#define elf_backend_fixup_symbol elf32_mips_fixup_symbol
#define elf_backend_grok_prstatus elf32_mips_grok_prstatus
#define elf_backend_grok_psinfo elf32_mips_grok_psinfo
Index: binutils/bfd/elf64-mips.c
===================================================================
--- binutils.orig/bfd/elf64-mips.c 2018-07-16 03:27:55.732051471 +0100
+++ binutils/bfd/elf64-mips.c 2018-07-16 03:28:00.000000000 +0100
@@ -4772,6 +4772,7 @@ const struct elf_size_info mips_elf64_si
#define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook
#define elf_backend_copy_indirect_symbol \
_bfd_mips_elf_copy_indirect_symbol
+#define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol
#define elf_backend_ignore_discarded_relocs \
_bfd_mips_elf_ignore_discarded_relocs
#define elf_backend_mips_irix_compat elf64_mips_irix_compat
Index: binutils/bfd/elfn32-mips.c
===================================================================
--- binutils.orig/bfd/elfn32-mips.c 2018-07-16 03:27:55.759465354 +0100
+++ binutils/bfd/elfn32-mips.c 2018-07-16 03:28:00.000000000 +0100
@@ -4136,6 +4136,7 @@ static const struct ecoff_debug_swap mip
#define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook
#define elf_backend_copy_indirect_symbol \
_bfd_mips_elf_copy_indirect_symbol
+#define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol
#define elf_backend_grok_prstatus elf32_mips_grok_prstatus
#define elf_backend_grok_psinfo elf32_mips_grok_psinfo
#define elf_backend_grok_freebsd_prstatus \
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c 2018-07-16 01:25:28.061011229 +0100
+++ binutils/bfd/elfxx-mips.c 2018-07-16 03:28:34.000000000 +0100
@@ -455,6 +455,12 @@ struct mips_elf_link_hash_table
/* True if we already reported the small-data section overflow. */
bfd_boolean small_data_overflow_reported;

+ /* True if we use the special `__gnu_absolute_zero' symbol. */
+ bfd_boolean use_absolute_zero;
+
+ /* True if we have been configured for a GNU target. */
+ bfd_boolean gnu_target;
+
/* Shortcuts to some dynamic sections, or NULL if they are not
being used. */
asection *srelplt2;
@@ -3977,7 +3983,7 @@ mips_elf_record_global_got_symbol (struc
{
case STV_INTERNAL:
case STV_HIDDEN:
- _bfd_elf_link_hash_hide_symbol (info, h, TRUE);
+ _bfd_mips_elf_hide_symbol (info, h, TRUE);
break;
}
if (!bfd_elf_link_record_dynamic_symbol (info, h))
@@ -4434,6 +4440,12 @@ mips_use_local_got_p (struct bfd_link_in
if (h->root.dynindx == -1)
return TRUE;

+ /* Absolute symbols, if ever they need a GOT entry, cannot ever go
+ to the local GOT, as they would be implicitly relocated by the
+ base address by the dynamic loader. */
+ if (bfd_is_abs_symbol (&h->root.root))
+ return FALSE;
+
/* Symbols that bind locally can (and in the case of forced-local
symbols, must) live in the local GOT. */
if (h->got_only_for_calls
@@ -5234,6 +5246,24 @@ mips_elf_relocation_needs_la25_stub (bfd
}
}

+/* Obtain the field relocated by RELOCATION. */
+
+static bfd_vma
+mips_elf_obtain_contents (reloc_howto_type *howto,
+ const Elf_Internal_Rela *relocation,
+ bfd *input_bfd, bfd_byte *contents)
+{
+ bfd_vma x = 0;
+ bfd_byte *location = contents + relocation->r_offset;
+ unsigned int size = bfd_get_reloc_size (howto);
+
+ /* Obtain the bytes. */
+ if (size != 0)
+ x = bfd_get (8 * size, input_bfd, location);
+
+ return x;
+}
+
/* Store the field relocated by RELOCATION. */

static void
@@ -5249,6 +5279,52 @@ mips_elf_store_contents (reloc_howto_typ
bfd_put (8 * size, input_bfd, x, location);
}

+/* Try to patch a load from GOT instruction in CONTENTS pointed to by
+ RELOCATION described by HOWTO, with a move of 0 to the load target
+ register, returning TRUE if that is successful and FALSE otherwise.
+ If DOIT is FALSE, then only determine it patching is possible and
+ return status without actually changing CONTENTS.
+*/
+
+static bfd_boolean
+mips_elf_nullify_got_load (bfd *input_bfd, bfd_byte *contents,
+ const Elf_Internal_Rela *relocation,
+ reloc_howto_type *howto, bfd_boolean doit)
+{
+ int r_type = ELF_R_TYPE (input_bfd, relocation->r_info);
+ bfd_byte *location = contents + relocation->r_offset;
+ bfd_boolean nullified = TRUE;
+ bfd_vma x;
+
+ _bfd_mips_elf_reloc_unshuffle (input_bfd, r_type, FALSE, location);
+
+ /* Obtain the current value. */
+ x = mips_elf_obtain_contents (howto, relocation, input_bfd, contents);
+
+ /* Note that in the unshuffled MIPS16 encoding RX is at bits [21:19]
+ while RY is at bits [18:16] of the combined 32-bit instruction word. */
+ if (mips16_reloc_p (r_type)
+ && (((x >> 22) & 0x3ff) == 0x3d3 /* LW */
+ || ((x >> 22) & 0x3ff) == 0x3c7)) /* LD */
+ x = (0x3cd << 22) | (x & (7 << 16)) << 3; /* LI */
+ else if (micromips_reloc_p (r_type)
+ && ((x >> 26) & 0x37) == 0x37) /* LW/LD */
+ x = (0xc << 26) | (x & (0x1f << 21)); /* ADDIU */
+ else if (((x >> 26) & 0x3f) == 0x23 /* LW */
+ || ((x >> 26) & 0x3f) == 0x37) /* LD */
+ x = (0x9 << 26) | (x & (0x1f << 16)); /* ADDIU */
+ else
+ nullified = FALSE;
+
+ /* Put the value into the output. */
+ if (doit && nullified)
+ mips_elf_store_contents (howto, relocation, input_bfd, contents, x);
+
+ _bfd_mips_elf_reloc_shuffle (input_bfd, r_type, FALSE, location);
+
+ return nullified;
+}
+
/* Calculate the value produced by the RELOCATION (which comes from
the INPUT_BFD). The ADDEND is the addend to use for this
RELOCATION; RELOCATION->R_ADDEND is ignored.
@@ -5264,7 +5340,7 @@ mips_elf_store_contents (reloc_howto_typ

static bfd_reloc_status_type
mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
- asection *input_section,
+ asection *input_section, bfd_byte *contents,
struct bfd_link_info *info,
const Elf_Internal_Rela *relocation,
bfd_vma addend, reloc_howto_type *howto,
@@ -5660,6 +5736,48 @@ mips_elf_calculate_relocation (bfd *abfd
&& (target_is_16_bit_code_p
|| target_is_micromips_code_p))));

+ resolved_to_zero = (h != NULL
+ && UNDEFWEAK_NO_DYNAMIC_RELOC (info, &h->root));
+
+ switch (r_type)
+ {
+ case R_MIPS16_CALL16:
+ case R_MIPS16_GOT16:
+ case R_MIPS_CALL16:
+ case R_MIPS_GOT16:
+ case R_MIPS_GOT_PAGE:
+ case R_MIPS_GOT_DISP:
+ case R_MIPS_GOT_LO16:
+ case R_MIPS_CALL_LO16:
+ case R_MICROMIPS_CALL16:
+ case R_MICROMIPS_GOT16:
+ case R_MICROMIPS_GOT_PAGE:
+ case R_MICROMIPS_GOT_DISP:
+ case R_MICROMIPS_GOT_LO16:
+ case R_MICROMIPS_CALL_LO16:
+ if (resolved_to_zero
+ && !bfd_link_relocatable (info)
+ && mips_elf_nullify_got_load (input_bfd, contents,
+ relocation, howto, TRUE))
+ return bfd_reloc_continue;
+
+ /* Fall through. */
+ case R_MIPS_GOT_HI16:
+ case R_MIPS_CALL_HI16:
+ case R_MICROMIPS_GOT_HI16:
+ case R_MICROMIPS_CALL_HI16:
+ if (resolved_to_zero
+ && htab->use_absolute_zero
+ && bfd_link_pic (info))
+ {
+ /* Redirect to the special `__gnu_absolute_zero' symbol. */
+ h = mips_elf_link_hash_lookup (htab, "__gnu_absolute_zero",
+ FALSE, FALSE, FALSE);
+ BFD_ASSERT (h != NULL);
+ }
+ break;
+ }
+
local_p = (h == NULL || mips_use_local_got_p (info, h));

gp0 = _bfd_get_gp_value (input_bfd);
@@ -5680,10 +5798,6 @@ mips_elf_calculate_relocation (bfd *abfd
addend = 0;
}

- resolved_to_zero = (h != NULL
- && UNDEFWEAK_NO_DYNAMIC_RELOC (info,
- &h->root));
-
/* If we haven't already determined the GOT offset, and we're going
to need it, get it now. */
switch (r_type)
@@ -6323,24 +6437,6 @@ mips_elf_calculate_relocation (bfd *abfd
return overflowed_p ? bfd_reloc_overflow : bfd_reloc_ok;
}

-/* Obtain the field relocated by RELOCATION. */
-
-static bfd_vma
-mips_elf_obtain_contents (reloc_howto_type *howto,
- const Elf_Internal_Rela *relocation,
- bfd *input_bfd, bfd_byte *contents)
-{
- bfd_vma x = 0;
- bfd_byte *location = contents + relocation->r_offset;
- unsigned int size = bfd_get_reloc_size (howto);
-
- /* Obtain the bytes. */
- if (size != 0)
- x = bfd_get (8 * size, input_bfd, location);
-
- return x;
-}
-
/* It has been determined that the result of the RELOCATION is the
VALUE. Use HOWTO to place VALUE into the output file at the
appropriate position. The SECTION is the section to which the
@@ -8103,6 +8199,47 @@ mips_elf_make_plt_record (bfd *abfd)
return entry;
}

+/* Define the special `__gnu_absolute_zero' symbol. We only need this
+ for PIC code, as otherwise there is no load-time relocation involved
+ and local GOT entries whose value is zero at static link time will
+ retain their value at load time. */
+
+static bfd_boolean
+mips_elf_define_absolute_zero (bfd *abfd, struct bfd_link_info *info,
+ struct mips_elf_link_hash_table *htab,
+ unsigned int r_type)
+{
+ union
+ {
+ struct elf_link_hash_entry *eh;
+ struct bfd_link_hash_entry *bh;
+ }
+ hzero;
+
+ BFD_ASSERT (!htab->use_absolute_zero);
+ BFD_ASSERT (bfd_link_pic (info));
+
+ hzero.bh = NULL;
+ if (!_bfd_generic_link_add_one_symbol (info, abfd, "__gnu_absolute_zero",
+ BSF_GLOBAL, bfd_abs_section_ptr, 0,
+ NULL, FALSE, FALSE, &hzero.bh))
+ return FALSE;
+
+ BFD_ASSERT (hzero.bh != NULL);
+ hzero.eh->size = 0;
+ hzero.eh->type = STT_NOTYPE;
+ hzero.eh->other = STV_PROTECTED;
+ hzero.eh->def_regular = 1;
+ hzero.eh->non_elf = 0;
+
+ if (!mips_elf_record_global_got_symbol (hzero.eh, abfd, info, TRUE, r_type))
+ return FALSE;
+
+ htab->use_absolute_zero = TRUE;
+
+ return TRUE;
+}
+
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table and record the need for
standard MIPS and compressed procedure linkage table entries. */
@@ -8455,24 +8592,52 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
/* Fall through. */

case R_MIPS_GOT16:
- case R_MIPS_GOT_HI16:
case R_MIPS_GOT_LO16:
case R_MIPS_GOT_PAGE:
- case R_MIPS_GOT_OFST:
case R_MIPS_GOT_DISP:
+ case R_MIPS16_GOT16:
+ case R_MICROMIPS_GOT16:
+ case R_MICROMIPS_GOT_LO16:
+ case R_MICROMIPS_GOT_PAGE:
+ case R_MICROMIPS_GOT_DISP:
+ /* If we have a symbol that will resolve to zero at static link
+ time and it is used by a GOT relocation applied to code we
+ cannot relax to an immediate zero load, then we will be using
+ the special `__gnu_absolute_zero' symbol whose value is zero
+ at dynamic load time. We ignore HI16-type GOT relocations at
+ this stage, because their handling will depend entirely on
+ the corresponding LO16-type GOT relocation. */
+ if (!call_hi16_reloc_p (r_type)
+ && h != NULL
+ && bfd_link_pic (info)
+ && !htab->use_absolute_zero
+ && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
+ {
+ bfd_boolean rel_reloc;
+
+ if (!mips_elf_get_section_contents (abfd, sec, &contents))
+ return FALSE;
+
+ rel_reloc = mips_elf_rel_relocation_p (abfd, sec, relocs, rel);
+ howto = MIPS_ELF_RTYPE_TO_HOWTO (abfd, r_type, !rel_reloc);
+
+ if (!mips_elf_nullify_got_load (abfd, contents, rel, howto,
+ FALSE))
+ if (!mips_elf_define_absolute_zero (abfd, info, htab, r_type))
+ return FALSE;
+ }
+
+ /* Fall through. */
+ case R_MIPS_GOT_HI16:
+ case R_MIPS_GOT_OFST:
case R_MIPS_TLS_GOTTPREL:
case R_MIPS_TLS_GD:
case R_MIPS_TLS_LDM:
- case R_MIPS16_GOT16:
case R_MIPS16_TLS_GOTTPREL:
case R_MIPS16_TLS_GD:
case R_MIPS16_TLS_LDM:
- case R_MICROMIPS_GOT16:
case R_MICROMIPS_GOT_HI16:
- case R_MICROMIPS_GOT_LO16:
- case R_MICROMIPS_GOT_PAGE:
case R_MICROMIPS_GOT_OFST:
- case R_MICROMIPS_GOT_DISP:
case R_MICROMIPS_TLS_GOTTPREL:
case R_MICROMIPS_TLS_GD:
case R_MICROMIPS_TLS_LDM:
@@ -10273,10 +10438,10 @@ _bfd_mips_elf_relocate_section (bfd *out

/* Figure out what value we are supposed to relocate. */
switch (mips_elf_calculate_relocation (output_bfd, input_bfd,
- input_section, info, rel,
- addend, howto, local_syms,
- local_sections, &value,
- &name, &cross_mode_jump_p,
+ input_section, contents,
+ info, rel, addend, howto,
+ local_syms, local_sections,
+ &value, &name, &cross_mode_jump_p,
use_saved_addend_p))
{
case bfd_reloc_continue:
@@ -12573,6 +12738,27 @@ _bfd_mips_elf_copy_indirect_symbol (stru
if (indmips->has_nonpic_branches)
dirmips->has_nonpic_branches = TRUE;
}
+
+/* Take care of the special `__gnu_absolute_zero' symbol and ignore attempts
+ to hide it. It has to remain global (it will also be protected) so as to
+ be assigned a global GOT entry, which will then remain unchanged at load
+ time. */
+
+void
+_bfd_mips_elf_hide_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *entry,
+ bfd_boolean force_local)
+{
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
+ BFD_ASSERT (htab != NULL);
+ if (htab->use_absolute_zero
+ && strcmp (entry->root.root.string, "__gnu_absolute_zero") == 0)
+ return;
+
+ _bfd_elf_link_hash_hide_symbol (info, entry, force_local);
+}

#define PDR_SIZE 32

@@ -13975,14 +14161,17 @@ _bfd_mips_elf_use_plts_and_copy_relocs (

/* A function that the linker calls to select between all or only
32-bit microMIPS instructions, and between making or ignoring
- branch relocation checks for invalid transitions between ISA modes. */
+ branch relocation checks for invalid transitions between ISA modes.
+ Also record whether we have been configured for a GNU target. */

void
_bfd_mips_elf_linker_flags (struct bfd_link_info *info, bfd_boolean insn32,
- bfd_boolean ignore_branch_isa)
+ bfd_boolean ignore_branch_isa,
+ bfd_boolean gnu_target)
{
mips_elf_hash_table (info)->insn32 = insn32;
mips_elf_hash_table (info)->ignore_branch_isa = ignore_branch_isa;
+ mips_elf_hash_table (info)->gnu_target = gnu_target;
}

/* Structure for saying that BFD machine EXTENSION extends BASE. */
@@ -16250,13 +16439,14 @@ enum
MIPS_LIBC_ABI_MIPS_PLT,
MIPS_LIBC_ABI_UNIQUE,
MIPS_LIBC_ABI_MIPS_O32_FP64,
+ MIPS_LIBC_ABI_ABSOLUTE,
MIPS_LIBC_ABI_MAX
};

void
_bfd_mips_post_process_headers (bfd *abfd, struct bfd_link_info *link_info)
{
- struct mips_elf_link_hash_table *htab;
+ struct mips_elf_link_hash_table *htab = NULL;
Elf_Internal_Ehdr *i_ehdrp;

i_ehdrp = elf_elfheader (abfd);
@@ -16264,15 +16454,19 @@ _bfd_mips_post_process_headers (bfd *abf
{
htab = mips_elf_hash_table (link_info);
BFD_ASSERT (htab != NULL);
-
- if (htab->use_plts_and_copy_relocs && !htab->is_vxworks)
- i_ehdrp->e_ident[EI_ABIVERSION] = MIPS_LIBC_ABI_MIPS_PLT;
}

+ if (htab != NULL && htab->use_plts_and_copy_relocs && !htab->is_vxworks)
+ i_ehdrp->e_ident[EI_ABIVERSION] = MIPS_LIBC_ABI_MIPS_PLT;
+
if (mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64
|| mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64A)
i_ehdrp->e_ident[EI_ABIVERSION] = MIPS_LIBC_ABI_MIPS_O32_FP64;

+ /* Mark that we need support for absolute symbols in the dynamic loader. */
+ if (htab != NULL && htab->use_absolute_zero && htab->gnu_target)
+ i_ehdrp->e_ident[EI_ABIVERSION] = MIPS_LIBC_ABI_ABSOLUTE;
+
_bfd_elf_post_process_headers (abfd, link_info);
}

Index: binutils/bfd/elfxx-mips.h
===================================================================
--- binutils.orig/bfd/elfxx-mips.h 2018-07-16 03:27:55.788697413 +0100
+++ binutils/bfd/elfxx-mips.h 2018-07-16 03:28:34.000000000 +0100
@@ -81,6 +81,8 @@ extern asection * _bfd_mips_elf_gc_mark_
extern void _bfd_mips_elf_copy_indirect_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *);
+extern void _bfd_mips_elf_hide_symbol
+ (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
extern bfd_boolean _bfd_mips_elf_ignore_discarded_relocs
(asection *);
extern bfd_boolean _bfd_mips_elf_is_target_special_symbol
@@ -147,7 +149,7 @@ extern bfd_boolean _bfd_mips_elf_ignore_
extern void _bfd_mips_elf_use_plts_and_copy_relocs
(struct bfd_link_info *);
extern void _bfd_mips_elf_linker_flags
- (struct bfd_link_info *, bfd_boolean, bfd_boolean);
+ (struct bfd_link_info *, bfd_boolean, bfd_boolean, bfd_boolean);
extern bfd_boolean _bfd_mips_elf_init_stubs
(struct bfd_link_info *,
asection *(*) (const char *, asection *, asection *));
Index: binutils/ld/emultempl/mipself.em
===================================================================
--- binutils.orig/ld/emultempl/mipself.em 2018-07-16 03:28:30.459375174 +0100
+++ binutils/ld/emultempl/mipself.em 2018-07-16 03:28:34.000000000 +0100
@@ -18,6 +18,15 @@
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.

+case ${target} in
+ *-*-*gnu*)
+ gnu_target=TRUE
+ ;;
+ *)
+ gnu_target=FALSE
+ ;;
+esac
+
fragment <<EOF

#include "ldctor.h"
@@ -203,7 +212,8 @@ mips_create_output_section_statements (v

htab = elf_hash_table (&link_info);
if (is_elf_hash_table (htab) && is_mips_elf (link_info.output_bfd))
- _bfd_mips_elf_linker_flags (&link_info, insn32, ignore_branch_isa);
+ _bfd_mips_elf_linker_flags (&link_info, insn32, ignore_branch_isa,
+ ${gnu_target});

if (is_mips_elf (link_info.output_bfd))
_bfd_mips_elf_init_stubs (&link_info, mips_add_stub_section);
Index: binutils/ld/testsuite/ld-mips-elf/pr21334.dd
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/pr21334.dd 2018-07-16 03:27:55.802856583 +0100
+++ binutils/ld/testsuite/ld-mips-elf/pr21334.dd 2018-07-16 03:28:00.000000000 +0100
@@ -4,7 +4,7 @@
[0-9a-f]+ <[^>]*> lui gp,0x1
[0-9a-f]+ <[^>]*> addiu gp,gp,-32736
[0-9a-f]+ <[^>]*> addu gp,gp,t9
-[0-9a-f]+ <[^>]*> lw v0,-32744\(gp\)
+[0-9a-f]+ <[^>]*> lwl v0,-32744\(gp\)
[0-9a-f]+ <[^>]*> jr ra
[0-9a-f]+ <[^>]*> addiu v0,v0,4
\.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21334.s
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/pr21334.s 2018-07-16 03:27:55.829058476 +0100
+++ binutils/ld/testsuite/ld-mips-elf/pr21334.s 2018-07-16 03:28:00.000000000 +0100
@@ -8,7 +8,7 @@
.mask 0x00000000, 0
.fmask 0x00000000, 0
.cpload $25
- lw $2, %got(bar)($28)
+ lwl $2, %got(bar)($28)
jr $31
addiu $2, $2, 4
.end foo
Maciej W. Rozycki
2018-07-17 17:51:02 UTC
Permalink
Define a new procedure, `run_mips_undefweak_test', and use it to iterate
over several scenarios involving undefined weak symbols resolving to
zero, verifying expected regular MIPS, MIPS16 and microMIPS code, GOT
and dynamic symbol table generation, as well as the setting of the
EI_ABIVERSION field in the ELF file header. In particular ensure that
symbol versioning works and that `__gnu_absolute_zero' gets assigned a
version (any will do) even if it has not been listed for exportation in
a linker version script.

ld/
PR ld/21375
* testsuite/ld-mips-elf/pr21375-abi.hd: New test.
* testsuite/ld-mips-elf/pr21375-noabi.hd: New test.
* testsuite/ld-mips-elf/pr21375.dd: New test.
* testsuite/ld-mips-elf/pr21375h.dd: New test.
* testsuite/ld-mips-elf/pr21375p.dd: New test.
* testsuite/ld-mips-elf/pr21375ph.dd: New test.
* testsuite/ld-mips-elf/pr21375s.dd: New test.
* testsuite/ld-mips-elf/pr21375s-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375s-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375sh.dd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375shg.dd: New test.
* testsuite/ld-mips-elf/pr21375sx.dd: New test.
* testsuite/ld-mips-elf/pr21375sxh.dd: New test.
* testsuite/ld-mips-elf/pr21375sm16.dd: New test.
* testsuite/ld-mips-elf/pr21375sm16h.dd: New test.
* testsuite/ld-mips-elf/pr21375su.dd: New test.
* testsuite/ld-mips-elf/pr21375su-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375su-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375suh.dd: New test.
* testsuite/ld-mips-elf/pr21375suh-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375suh-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375sux.dd: New test.
* testsuite/ld-mips-elf/pr21375suxh.dd: New test.
* testsuite/ld-mips-elf/pr21375.gd: New test.
* testsuite/ld-mips-elf/pr21375h.gd: New test.
* testsuite/ld-mips-elf/pr21375p.gd: New test.
* testsuite/ld-mips-elf/pr21375ph.gd: New test.
* testsuite/ld-mips-elf/pr21375s.gd: New test.
* testsuite/ld-mips-elf/pr21375s-n32.gd: New test.
* testsuite/ld-mips-elf/pr21375s-n64.gd: New test.
* testsuite/ld-mips-elf/pr21375sh.gd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32.gd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64.gd: New test.
* testsuite/ld-mips-elf/pr21375shg.gd: New test.
* testsuite/ld-mips-elf/pr21375shl.gd: New test.
* testsuite/ld-mips-elf/pr21375shv.gd: New test.
* testsuite/ld-mips-elf/pr21375sx.gd: New test.
* testsuite/ld-mips-elf/pr21375sxh.gd: New test.
* testsuite/ld-mips-elf/pr21375.sd: New test.
* testsuite/ld-mips-elf/pr21375-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375h.sd: New test.
* testsuite/ld-mips-elf/pr21375h-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375p.sd: New test.
* testsuite/ld-mips-elf/pr21375p-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375ph.sd: New test.
* testsuite/ld-mips-elf/pr21375ph-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375s.sd: New test.
* testsuite/ld-mips-elf/pr21375s-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n32.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n32-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n64.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n64-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sh.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375shg.sd: New test.
* testsuite/ld-mips-elf/pr21375shg-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375shl.sd: New test.
* testsuite/ld-mips-elf/pr21375shl-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375shv.sd: New test.
* testsuite/ld-mips-elf/pr21375shv-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sx.sd: New test.
* testsuite/ld-mips-elf/pr21375sx-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sxh.sd: New test.
* testsuite/ld-mips-elf/pr21375sxh-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375.ld: New test linker script.
* testsuite/ld-mips-elf/pr21375-xgot.ld: New test linker script.
* testsuite/ld-mips-elf/pr21375.ver: New test version script.
* testsuite/ld-mips-elf/pr21375v.ver: New test version script.
* testsuite/ld-mips-elf/pr21375.s: New test source.
* testsuite/ld-mips-elf/pr21375-mips16.s: New test source.
* testsuite/ld-mips-elf/pr21375-n32.s: New test source.
* testsuite/ld-mips-elf/pr21375-n64.s: New test source.
* testsuite/ld-mips-elf/pr21375-xgot.s: New test source.
* testsuite/ld-mips-elf/mips-elf.exp (run_mips_undefweak_test):
New procedure; run the new tests.
---
ld/testsuite/ld-mips-elf/mips-elf.exp | 192 +++++++++++++++++++++++++
ld/testsuite/ld-mips-elf/pr21375-abi.hd | 4
ld/testsuite/ld-mips-elf/pr21375-irix.sd | 1
ld/testsuite/ld-mips-elf/pr21375-mips16.s | 63 ++++++++
ld/testsuite/ld-mips-elf/pr21375-n32.s | 59 +++++++
ld/testsuite/ld-mips-elf/pr21375-n64.s | 59 +++++++
ld/testsuite/ld-mips-elf/pr21375-noabi.hd | 4
ld/testsuite/ld-mips-elf/pr21375-xgot.ld | 20 ++
ld/testsuite/ld-mips-elf/pr21375-xgot.s | 62 ++++++++
ld/testsuite/ld-mips-elf/pr21375.dd | 23 ++
ld/testsuite/ld-mips-elf/pr21375.gd | 12 +
ld/testsuite/ld-mips-elf/pr21375.ld | 20 ++
ld/testsuite/ld-mips-elf/pr21375.s | 54 +++++++
ld/testsuite/ld-mips-elf/pr21375.sd | 1
ld/testsuite/ld-mips-elf/pr21375.ver | 1
ld/testsuite/ld-mips-elf/pr21375h-irix.sd | 1
ld/testsuite/ld-mips-elf/pr21375h.dd | 23 ++
ld/testsuite/ld-mips-elf/pr21375h.gd | 12 +
ld/testsuite/ld-mips-elf/pr21375h.sd | 1
ld/testsuite/ld-mips-elf/pr21375p-irix.sd | 10 +
ld/testsuite/ld-mips-elf/pr21375p.dd | 23 ++
ld/testsuite/ld-mips-elf/pr21375p.gd | 12 +
ld/testsuite/ld-mips-elf/pr21375p.sd | 7
ld/testsuite/ld-mips-elf/pr21375ph-irix.sd | 9 +
ld/testsuite/ld-mips-elf/pr21375ph.dd | 23 ++
ld/testsuite/ld-mips-elf/pr21375ph.gd | 16 ++
ld/testsuite/ld-mips-elf/pr21375ph.sd | 6
ld/testsuite/ld-mips-elf/pr21375s-irix.sd | 9 +
ld/testsuite/ld-mips-elf/pr21375s-n32-irix.sd | 5
ld/testsuite/ld-mips-elf/pr21375s-n32.dd | 27 +++
ld/testsuite/ld-mips-elf/pr21375s-n32.gd | 11 +
ld/testsuite/ld-mips-elf/pr21375s-n32.sd | 5
ld/testsuite/ld-mips-elf/pr21375s-n64-irix.sd | 5
ld/testsuite/ld-mips-elf/pr21375s-n64.dd | 27 +++
ld/testsuite/ld-mips-elf/pr21375s-n64.gd | 11 +
ld/testsuite/ld-mips-elf/pr21375s-n64.sd | 5
ld/testsuite/ld-mips-elf/pr21375s.dd | 23 ++
ld/testsuite/ld-mips-elf/pr21375s.gd | 12 +
ld/testsuite/ld-mips-elf/pr21375s.sd | 6
ld/testsuite/ld-mips-elf/pr21375sh-irix.sd | 8 +
ld/testsuite/ld-mips-elf/pr21375sh-n32-irix.sd | 5
ld/testsuite/ld-mips-elf/pr21375sh-n32.dd | 27 +++
ld/testsuite/ld-mips-elf/pr21375sh-n32.gd | 15 +
ld/testsuite/ld-mips-elf/pr21375sh-n32.sd | 5
ld/testsuite/ld-mips-elf/pr21375sh-n64-irix.sd | 5
ld/testsuite/ld-mips-elf/pr21375sh-n64.dd | 27 +++
ld/testsuite/ld-mips-elf/pr21375sh-n64.gd | 15 +
ld/testsuite/ld-mips-elf/pr21375sh-n64.sd | 5
ld/testsuite/ld-mips-elf/pr21375sh.dd | 23 ++
ld/testsuite/ld-mips-elf/pr21375sh.gd | 16 ++
ld/testsuite/ld-mips-elf/pr21375sh.sd | 5
ld/testsuite/ld-mips-elf/pr21375shg-irix.sd | 7
ld/testsuite/ld-mips-elf/pr21375shg.dd | 13 +
ld/testsuite/ld-mips-elf/pr21375shg.gd | 12 +
ld/testsuite/ld-mips-elf/pr21375shg.sd | 4
ld/testsuite/ld-mips-elf/pr21375shl-irix.sd | 5
ld/testsuite/ld-mips-elf/pr21375shl.gd | 16 ++
ld/testsuite/ld-mips-elf/pr21375shl.sd | 5
ld/testsuite/ld-mips-elf/pr21375shv-irix.sd | 6
ld/testsuite/ld-mips-elf/pr21375shv.gd | 16 ++
ld/testsuite/ld-mips-elf/pr21375shv.sd | 6
ld/testsuite/ld-mips-elf/pr21375sm16.dd | 28 +++
ld/testsuite/ld-mips-elf/pr21375sm16h.dd | 28 +++
ld/testsuite/ld-mips-elf/pr21375su-n32.dd | 29 +++
ld/testsuite/ld-mips-elf/pr21375su-n64.dd | 29 +++
ld/testsuite/ld-mips-elf/pr21375su.dd | 25 +++
ld/testsuite/ld-mips-elf/pr21375suh-n32.dd | 29 +++
ld/testsuite/ld-mips-elf/pr21375suh-n64.dd | 29 +++
ld/testsuite/ld-mips-elf/pr21375suh.dd | 25 +++
ld/testsuite/ld-mips-elf/pr21375sux.dd | 33 ++++
ld/testsuite/ld-mips-elf/pr21375suxh.dd | 33 ++++
ld/testsuite/ld-mips-elf/pr21375sx-irix.sd | 9 +
ld/testsuite/ld-mips-elf/pr21375sx.dd | 31 ++++
ld/testsuite/ld-mips-elf/pr21375sx.gd | 12 +
ld/testsuite/ld-mips-elf/pr21375sx.sd | 6
ld/testsuite/ld-mips-elf/pr21375sxh-irix.sd | 8 +
ld/testsuite/ld-mips-elf/pr21375sxh.dd | 31 ++++
ld/testsuite/ld-mips-elf/pr21375sxh.gd | 16 ++
ld/testsuite/ld-mips-elf/pr21375sxh.sd | 5
ld/testsuite/ld-mips-elf/pr21375v.ver | 1
80 files changed, 1517 insertions(+)

binutils-mips-bfd-exec-undefweak-got-test.diff
Index: binutils/ld/testsuite/ld-mips-elf/mips-elf.exp
===================================================================
--- binutils.orig/ld/testsuite/ld-mips-elf/mips-elf.exp 2018-07-13 18:05:15.650817049 +0100
+++ binutils/ld/testsuite/ld-mips-elf/mips-elf.exp 2018-07-16 03:36:23.168963269 +0100
@@ -1437,3 +1437,195 @@ run_dump_test "mips-abiflags-2r"

# Test that _gp_disp symbol is not present in symbol tables.
run_dump_test_o32 "gp-disp-sym"
+
+# PR ld/21375 undefined weak PIC references.
+proc run_mips_undefweak_test { name abi args } {
+ global abi_asflags
+ global abi_ldflags
+ global irixemul
+
+ set name "PR ld/21375 in $name"
+
+ set pic 0
+ set abisuf -noabi
+ set srcsuf ""
+ set scrsuf ""
+ set binsuf ""
+ set dsosuf ""
+ set objsuf ""
+ set rdesuf ""
+ set asxtra ""
+ set ldxtra ""
+ foreach arg $args {
+ switch -- $arg {
+ dso {
+ set pic 1
+ set dsosuf .so
+ append objsuf s
+ append rdesuf s
+ append ldxtra " -shared"
+ }
+ gc {
+ set abisuf -noabi
+ append binsuf g
+ append objsuf g
+ append rdesuf g
+ append ldxtra " --gc-sections"
+ }
+ hidden {
+ if { $pic && [istarget "*-*-*gnu*"] } { set abisuf -abi }
+ append binsuf h
+ append objsuf h
+ append rdesuf h
+ append asxtra " --defsym hidn=1"
+ }
+ internal {
+ if { $pic && [istarget "*-*-*gnu*"] } { set abisuf -abi }
+ append binsuf h
+ append objsuf h
+ append rdesuf h
+ append asxtra " --defsym intr=1"
+ }
+ local {
+ append binsuf l
+ append rdesuf l
+ append ldxtra " --version-script pr21375.ver"
+ }
+ mips16 {
+ set srcsuf -mips16
+ append binsuf m16
+ append objsuf m16
+ append asxtra " -mips16"
+ }
+ pie {
+ set pic 1
+ set dsosuf -pie
+ append objsuf p
+ append rdesuf p
+ append ldxtra " -pie"
+ }
+ protected {
+ if { $pic && [istarget "*-*-*gnu*"] } { set abisuf -abi }
+ append binsuf h
+ append objsuf h
+ append rdesuf h
+ append asxtra " --defsym prot=1"
+ }
+ umips {
+ append binsuf u
+ append objsuf u
+ append asxtra " -mmicromips"
+ }
+ version {
+ append binsuf v
+ append rdesuf v
+ append ldxtra " --version-script pr21375v.ver"
+ }
+ xgot {
+ set srcsuf -xgot
+ set scrsuf -xgot
+ append binsuf x
+ append objsuf x
+ append rdesuf x
+ }
+ }
+ }
+ switch -- $abi {
+ n32 {
+ set srcsuf -n32
+ append binsuf -n32
+ append objsuf -n32
+ append rdesuf -n32
+ }
+ n64 {
+ set srcsuf -n64
+ append binsuf -n64
+ append objsuf -n64
+ append rdesuf -n64
+ }
+ }
+ if $irixemul {
+ set irixsuf -irix
+ } else {
+ set irixsuf ""
+ }
+
+ if { $pic && ![check_shared_lib_support] } {
+ unsupported "$name"
+ } else {
+ run_ld_link_tests [list \
+ [list \
+ "$name" \
+ "$abi_ldflags($abi) -e foo -T pr21375${scrsuf}.ld ${ldxtra}" \
+ "" \
+ "$abi_asflags($abi) ${asxtra}" \
+ [list pr21375${srcsuf}.s] \
+ [list \
+ [list objdump -d pr21375${objsuf}.dd] \
+ [list readelf -A pr21375${rdesuf}.gd] \
+ [list readelf --dyn-syms pr21375${rdesuf}${irixsuf}.sd] \
+ [list readelf -h pr21375${abisuf}.hd]] \
+ "pr21375${binsuf}${dsosuf}"]]
+ }
+}
+
+if $has_abi(o32) {
+ run_mips_undefweak_test "SVR4 executable" \
+ o32
+ run_mips_undefweak_test "SVR4 executable (hidden)" \
+ o32 hidden
+ run_mips_undefweak_test "PIE executable" \
+ o32 pie
+ run_mips_undefweak_test "PIE executable (hidden)" \
+ o32 pie hidden
+ run_mips_undefweak_test "shared library" \
+ o32 dso
+ run_mips_undefweak_test "shared library (hidden)" \
+ o32 dso hidden
+ run_mips_undefweak_test "shared library (hidden, forced local)" \
+ o32 dso hidden local
+ run_mips_undefweak_test "shared library (hidden, versioned)" \
+ o32 dso hidden version
+ run_mips_undefweak_test "shared library (hidden, section GC)" \
+ o32 dso hidden gc
+ run_mips_undefweak_test "shared library (protected)" \
+ o32 dso protected
+ run_mips_undefweak_test "shared library (internal)" \
+ o32 dso internal
+ run_mips_undefweak_test "shared library (large GOT)" \
+ o32 dso xgot
+ run_mips_undefweak_test "shared library (large GOT, hidden)" \
+ o32 dso xgot hidden
+ run_mips_undefweak_test "shared library (MIPS16)" \
+ o32 dso mips16
+ run_mips_undefweak_test "shared library (MIPS16, hidden)" \
+ o32 dso mips16 hidden
+ run_mips_undefweak_test "shared library (microMIPS)" \
+ o32 dso umips
+ run_mips_undefweak_test "shared library (microMIPS, hidden)" \
+ o32 dso umips hidden
+ run_mips_undefweak_test "shared library (microMIPS, large GOT)" \
+ o32 dso umips xgot
+ run_mips_undefweak_test "shared library (microMIPS, large GOT, hidden)" \
+ o32 dso umips xgot hidden
+}
+if $has_abi(n32) {
+ run_mips_undefweak_test "shared library (n32)" \
+ n32 dso
+ run_mips_undefweak_test "shared library (n32, hidden)" \
+ n32 dso hidden
+ run_mips_undefweak_test "shared library (n32, microMIPS)" \
+ n32 dso umips
+ run_mips_undefweak_test "shared library (n32, microMIPS, hidden)" \
+ n32 dso umips hidden
+}
+if $has_abi(n64) {
+ run_mips_undefweak_test "shared library (n64)" \
+ n64 dso
+ run_mips_undefweak_test "shared library (n64, hidden)" \
+ n64 dso hidden
+ run_mips_undefweak_test "shared library (n64, microMIPS)" \
+ n64 dso umips
+ run_mips_undefweak_test "shared library (n64, microMIPS, hidden)" \
+ n64 dso umips hidden
+}
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-abi.hd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-abi.hd 2018-07-16 03:35:47.486787577 +0100
@@ -0,0 +1,4 @@
+ELF Header:
+#...
+ +ABI Version: +4
+#pass
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-irix.sd 2018-07-16 03:35:21.011311713 +0100
@@ -0,0 +1 @@
+# Empty.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-mips16.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-mips16.s 2018-07-16 03:35:21.035512277 +0100
@@ -0,0 +1,63 @@
+ .abicalls
+ .set noreorder
+
+ .type fun, @function
+ .weak fun
+ .type obj, @object
+ .weak obj
+ .ifdef prot
+ .protected fun
+ .protected obj
+ .endif
+ .ifdef hidn
+ .hidden fun
+ .hidden obj
+ .endif
+ .ifdef intr
+ .internal fun
+ .internal obj
+ .endif
+
+ .section .text.foo, "ax", @progbits
+ .globl foo
+ .ent foo
+foo:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ li $2, %hi(_gp_disp)
+ addiu $3, $pc, %lo(_gp_disp)
+ sll $2, 16
+ addu $2, $3
+ lw $4, %got(obj)($2)
+ lw $2, %call16(fun)($2)
+ jr $2
+ move $25,$2
+ .end foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
+
+ .section .text.bar, "ax", @progbits
+ .ent bar
+bar:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ li $2, %hi(_gp_disp)
+ addiu $3, $pc, %lo(_gp_disp)
+ sll $2, 16
+ addu $2, $3
+ move $4, $2
+ addiu $4, %got(obj)
+ addiu $2, %call16(fun)
+ lw $2, 0($2)
+ lw $4, 0($4)
+ jr $2
+ move $25,$2
+ .end bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-n32.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-n32.s 2018-07-16 03:35:21.047583475 +0100
@@ -0,0 +1,59 @@
+ .abicalls
+ .set noreorder
+
+ .type obj, @object
+ .weak obj
+ .ifdef prot
+ .protected obj
+ .endif
+ .ifdef hidn
+ .hidden obj
+ .endif
+ .ifdef intr
+ .internal obj
+ .endif
+
+ .section .text.foo, "ax", @progbits
+ .globl foo
+ .ent foo
+foo:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cplocal $4
+ .cpsetup $25, $0, foo
+ lw $2, %got_page(obj + 4)($4)
+ lw $3, %got_disp(obj)($4)
+ addiu $2, %got_ofst(obj + 4)
+ jr $31
+ addiu $3, 4
+ .end foo
+
+# Pad a little so that the microMIPS version aligns the same.
+ .space 4
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
+
+ .section .text.bar, "ax", @progbits
+ .ent bar
+bar:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cplocal $4
+ .cpsetup $25, $0, bar
+ lwl $2, %got_page(obj + 4)($4)
+ lwr $3, %got_disp(obj)($4)
+ addiu $2, %got_ofst(obj + 4)
+ jr $31
+ addiu $3, 4
+ .end bar
+
+# Pad a little so that the microMIPS version aligns the same.
+ .space 4
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-n64.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-n64.s 2018-07-16 03:35:21.062677011 +0100
@@ -0,0 +1,59 @@
+ .abicalls
+ .set noreorder
+
+ .type obj, @object
+ .weak obj
+ .ifdef prot
+ .protected obj
+ .endif
+ .ifdef hidn
+ .hidden obj
+ .endif
+ .ifdef intr
+ .internal obj
+ .endif
+
+ .section .text.foo, "ax", @progbits
+ .globl foo
+ .ent foo
+foo:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cplocal $4
+ .cpsetup $25, $0, foo
+ ld $2, %got_page(obj + 4)($4)
+ ld $3, %got_disp(obj)($4)
+ daddiu $2, %got_ofst(obj + 4)
+ jr $31
+ daddiu $3, 4
+ .end foo
+
+# Pad a little so that the microMIPS version aligns the same.
+ .space 4
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
+
+ .section .text.bar, "ax", @progbits
+ .ent bar
+bar:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cplocal $4
+ .cpsetup $25, $0, bar
+ ldl $2, %got_page(obj + 4)($4)
+ ldr $3, %got_disp(obj)($4)
+ daddiu $2, %got_ofst(obj + 4)
+ jr $31
+ daddiu $3, 4
+ .end bar
+
+# Pad a little so that the microMIPS version aligns the same.
+ .space 4
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-noabi.hd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-noabi.hd 2018-07-16 03:35:47.494968570 +0100
@@ -0,0 +1,4 @@
+ELF Header:
+#...
+ +ABI Version: +0
+#pass
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-xgot.ld
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-xgot.ld 2018-07-16 03:35:21.082785186 +0100
@@ -0,0 +1,20 @@
+SECTIONS
+{
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ /* Align up to account for traditional vs IRIX target differences
+ with the alignment of dynamic sections. This way GOT addresses
+ work out the same. */
+ .text : ALIGN (512) { *(.text*) }
+ HIDDEN (_gp = ALIGN (16) + 0x7fff8010);
+ .got : { *(.got) }
+ .symtab : { *(.symtab) }
+ .strtab : { *(.strtab) }
+ .shstrtab : { *(.shstrtab) }
+ /DISCARD/ : { *(*) }
+}
Index: binutils/ld/testsuite/ld-mips-elf/pr21375-xgot.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375-xgot.s 2018-07-16 03:35:21.113012405 +0100
@@ -0,0 +1,62 @@
+ .abicalls
+ .set noreorder
+
+ .type fun, @function
+ .weak fun
+ .type obj, @object
+ .weak obj
+ .ifdef prot
+ .protected fun
+ .protected obj
+ .endif
+ .ifdef hidn
+ .hidden fun
+ .hidden obj
+ .endif
+ .ifdef intr
+ .internal fun
+ .internal obj
+ .endif
+
+ .section .text.foo, "ax", @progbits
+ .globl foo
+ .ent foo
+foo:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cpload $25
+ lui $4, %got_hi(obj)
+ lui $25, %call_hi(fun)
+ addu $4, $28
+ addu $25, $28
+ lw $25, %call_lo(fun)($25)
+ lw $4, %got_lo(obj)($4)
+ jr $25
+ addiu $4, 4
+ .end foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
+
+ .section .text.bar, "ax", @progbits
+ .ent bar
+bar:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cpload $25
+ lui $4, %got_hi(obj)
+ lui $25, %call_hi(fun)
+ addu $4, $28
+ addu $25, $28
+ lwl $25, %call_lo(fun)($25)
+ lwr $4, %got_lo(obj)($4)
+ jr $25
+ addiu $4, 4
+ .end bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
Index: binutils/ld/testsuite/ld-mips-elf/pr21375.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375.dd 2018-07-16 03:35:21.126089413 +0100
@@ -0,0 +1,23 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8f998018 lw t9,-32744\(gp\)
+ *[0-9a-f]+: 8f84801c lw a0,-32740\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8020 addiu gp,gp,-32736
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8b998018 lwl t9,-32744\(gp\)
+ *[0-9a-f]+: 9b84801c lwr a0,-32740\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375.gd 2018-07-16 03:35:21.149236580 +0100
@@ -0,0 +1,12 @@
+Static GOT:
+ Canonical gp value: 00008050
+
+ Reserved entries:
+ Address Access Value
+ 00000060 -32752\(gp\) 00000000
+ 00000064 -32748\(gp\) 80000000
+
+ Local entries:
+ Address Access Value
+ 00000068 -32744\(gp\) 00000000
+ 0000006c -32740\(gp\) 00000000
Index: binutils/ld/testsuite/ld-mips-elf/pr21375.ld
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375.ld 2018-07-16 03:35:21.181403697 +0100
@@ -0,0 +1,20 @@
+SECTIONS
+{
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ /* Align up to account for traditional vs IRIX target differences
+ with the alignment of dynamic sections. This way GOT addresses
+ work out the same. */
+ .text : ALIGN (512) { *(.text*) }
+ HIDDEN (_gp = ALIGN (16) + 0x7ff0);
+ .got : { *(.got) }
+ .symtab : { *(.symtab) }
+ .strtab : { *(.strtab) }
+ .shstrtab : { *(.shstrtab) }
+ /DISCARD/ : { *(*) }
+}
Index: binutils/ld/testsuite/ld-mips-elf/pr21375.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375.s 2018-07-16 03:35:21.198502792 +0100
@@ -0,0 +1,54 @@
+ .abicalls
+ .set noreorder
+
+ .type fun, @function
+ .weak fun
+ .type obj, @object
+ .weak obj
+ .ifdef prot
+ .protected fun
+ .protected obj
+ .endif
+ .ifdef hidn
+ .hidden fun
+ .hidden obj
+ .endif
+ .ifdef intr
+ .internal fun
+ .internal obj
+ .endif
+
+ .section .text.foo, "ax", @progbits
+ .globl foo
+ .ent foo
+foo:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cpload $25
+ lw $25, %call16(fun)($28)
+ lw $4, %got(obj)($28)
+ jr $25
+ addiu $4, 4
+ .end foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
+
+ .section .text.bar, "ax", @progbits
+ .ent bar
+bar:
+ .frame $sp, 0, $31
+ .mask 0x00000000, 0
+ .fmask 0x00000000, 0
+ .cpload $25
+ lwl $25, %call16(fun)($28)
+ lwr $4, %got(obj)($28)
+ jr $25
+ addiu $4, 4
+ .end bar
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16
Index: binutils/ld/testsuite/ld-mips-elf/pr21375.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375.sd 2018-07-16 03:35:21.224840742 +0100
@@ -0,0 +1 @@
+# Empty.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375.ver
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375.ver 2018-07-16 03:35:21.252794080 +0100
@@ -0,0 +1 @@
+{ global: foo; local: *; };
Index: binutils/ld/testsuite/ld-mips-elf/pr21375h-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375h-irix.sd 2018-07-16 03:35:21.271301027 +0100
@@ -0,0 +1 @@
+# Empty.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375h.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375h.dd 2018-07-16 03:35:21.280570118 +0100
@@ -0,0 +1,23 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 24190000 li t9,0
+ *[0-9a-f]+: 24040000 li a0,0
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8020 addiu gp,gp,-32736
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8b998018 lwl t9,-32744\(gp\)
+ *[0-9a-f]+: 9b848018 lwr a0,-32744\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375h.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375h.gd 2018-07-16 03:35:21.290772907 +0100
@@ -0,0 +1,12 @@
+Static GOT:
+ Canonical gp value: 00008050
+
+ Reserved entries:
+ Address Access Value
+ 00000060 -32752\(gp\) 00000000
+ 00000064 -32748\(gp\) 80000000
+
+ Local entries:
+ Address Access Value
+ 00000068 -32744\(gp\) 00000000
+ 0000006c -32740\(gp\) 00000000
Index: binutils/ld/testsuite/ld-mips-elf/pr21375h.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375h.sd 2018-07-16 03:35:21.307212427 +0100
@@ -0,0 +1 @@
+# Empty.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375p-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375p-irix.sd 2018-07-16 03:35:21.334113003 +0100
@@ -0,0 +1,10 @@
+Symbol table '\.dynsym' contains 8 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 SECTION GLOBAL PROTECTED ABS _procedure_table_size
+ 2: 00000001 0 SECTION GLOBAL DEFAULT ABS _DYNAMIC_LINK
+ 3: 00000000 0 OBJECT GLOBAL DEFAULT ABS __rld_map
+ 4: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_string_table
+ 5: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_table
+ 6: 00000000 0 FUNC WEAK DEFAULT UND fun
+ 7: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375p.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375p.dd 2018-07-16 03:35:21.344465955 +0100
@@ -0,0 +1,23 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8f998018 lw t9,-32744\(gp\)
+ *[0-9a-f]+: 8f84801c lw a0,-32740\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8020 addiu gp,gp,-32736
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8b998018 lwl t9,-32744\(gp\)
+ *[0-9a-f]+: 9b84801c lwr a0,-32740\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375p.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375p.gd 2018-07-16 03:35:21.352698183 +0100
@@ -0,0 +1,12 @@
+Primary GOT:
+ Canonical gp value: 00008250
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000260 -32752\(gp\) 00000000 Lazy resolver
+ 00000264 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000268 -32744\(gp\) 00000000 00000000 FUNC UND fun
+ 0000026c -32740\(gp\) 00000000 00000000 OBJECT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375p.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375p.sd 2018-07-16 03:35:21.371088003 +0100
@@ -0,0 +1,7 @@
+Symbol table '\.dynsym' contains 5 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000001 0 SECTION GLOBAL DEFAULT ABS _DYNAMIC_LINKING
+ 2: 00000000 0 OBJECT GLOBAL DEFAULT ABS __RLD_MAP
+ 3: 00000000 0 FUNC WEAK DEFAULT UND fun
+ 4: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375ph-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375ph-irix.sd 2018-07-16 03:35:21.385485659 +0100
@@ -0,0 +1,9 @@
+Symbol table '\.dynsym' contains 7 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 SECTION GLOBAL PROTECTED ABS _procedure_table_size
+ 2: 00000001 0 SECTION GLOBAL DEFAULT ABS _DYNAMIC_LINK
+ 3: 00000000 0 OBJECT GLOBAL DEFAULT ABS __rld_map
+ 4: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_string_table
+ 5: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_table
+ 6: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375ph.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375ph.dd 2018-07-16 03:35:21.416383893 +0100
@@ -0,0 +1,23 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 24190000 li t9,0
+ *[0-9a-f]+: 24040000 li a0,0
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8020 addiu gp,gp,-32736
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8b998020 lwl t9,-32736\(gp\)
+ *[0-9a-f]+: 9b848020 lwr a0,-32736\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375ph.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375ph.gd 2018-07-16 03:35:21.439030087 +0100
@@ -0,0 +1,16 @@
+Primary GOT:
+ Canonical gp value: 00008250
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000260 -32752\(gp\) 00000000 Lazy resolver
+ 00000264 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00000268 -32744\(gp\) 00000000
+ 0000026c -32740\(gp\) 00000000
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000270 -32736\(gp\) 00000000 00000000 NOTYPE ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375ph.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375ph.sd 2018-07-16 03:35:21.466890643 +0100
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains 4 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000001 0 SECTION GLOBAL DEFAULT ABS _DYNAMIC_LINKING
+ 2: 00000000 0 OBJECT GLOBAL DEFAULT ABS __RLD_MAP
+ 3: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-irix.sd 2018-07-16 03:35:21.490488630 +0100
@@ -0,0 +1,9 @@
+Symbol table '\.dynsym' contains 7 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 SECTION GLOBAL PROTECTED ABS _procedure_table_size
+ 2: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_string_table
+ 3: 0000020. 2. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 4: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_table
+ 5: 00000000 0 FUNC WEAK DEFAULT UND fun
+ 6: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n32-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n32-irix.sd 2018-07-16 03:35:21.509887807 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 3. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 2: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n32.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n32.dd 2018-07-16 03:35:21.523182424 +0100
@@ -0,0 +1,27 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848070 addiu a0,a0,-32656
+ *[0-9a-f]+: 00992021 addu a0,a0,t9
+ *[0-9a-f]+: 8c828018 lw v0,-32744\(a0\)
+ *[0-9a-f]+: 8c838018 lw v1,-32744\(a0\)
+ *[0-9a-f]+: 24420004 addiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 24630004 addiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848030 addiu a0,a0,-32720
+ *[0-9a-f]+: 00992021 addu a0,a0,t9
+ *[0-9a-f]+: 88828018 lwl v0,-32744\(a0\)
+ *[0-9a-f]+: 98838018 lwr v1,-32744\(a0\)
+ *[0-9a-f]+: 24420004 addiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 24630004 addiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n32.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n32.gd 2018-07-16 03:35:21.540594513 +0100
@@ -0,0 +1,11 @@
+Primary GOT:
+ Canonical gp value: 00008270
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000280 -32752\(gp\) 00000000 Lazy resolver
+ 00000284 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000288 -32744\(gp\) 00000000 00000000 OBJECT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n32.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n32.sd 2018-07-16 03:35:21.560192969 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 3. FUNC GLOBAL DEFAULT 5 foo
+ 2: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n64-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n64-irix.sd 2018-07-16 03:35:21.581625011 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 000000000000020. 3. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 2: 0000000000000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n64.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n64.dd 2018-07-16 03:35:21.602059427 +0100
@@ -0,0 +1,27 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848070 addiu a0,a0,-32656
+ *[0-9a-f]+: 0099202d daddu a0,a0,t9
+ *[0-9a-f]+: dc828020 ld v0,-32736\(a0\)
+ *[0-9a-f]+: dc838020 ld v1,-32736\(a0\)
+ *[0-9a-f]+: 64420004 daddiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 64630004 daddiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848030 addiu a0,a0,-32720
+ *[0-9a-f]+: 0099202d daddu a0,a0,t9
+ *[0-9a-f]+: 68828020 ldl v0,-32736\(a0\)
+ *[0-9a-f]+: 6c838020 ldr v1,-32736\(a0\)
+ *[0-9a-f]+: 64420004 daddiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 64630004 daddiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n64.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n64.gd 2018-07-16 03:35:21.627341168 +0100
@@ -0,0 +1,11 @@
+Primary GOT:
+ Canonical gp value: 0000000000008270
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 0000000000000280 -32752\(gp\) 0000000000000000 Lazy resolver
+ 0000000000000288 -32744\(gp\) 8000000000000000 Module pointer \(GNU extension\)
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 0000000000000290 -32736\(gp\) 0000000000000000 0000000000000000 OBJECT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s-n64.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s-n64.sd 2018-07-16 03:35:21.642434126 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 000000000000020. 3. FUNC GLOBAL DEFAULT 5 foo
+ 2: 0000000000000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s.dd 2018-07-16 03:35:21.662655299 +0100
@@ -0,0 +1,23 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8f998018 lw t9,-32744\(gp\)
+ *[0-9a-f]+: 8f84801c lw a0,-32740\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8020 addiu gp,gp,-32736
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8b998018 lwl t9,-32744\(gp\)
+ *[0-9a-f]+: 9b84801c lwr a0,-32740\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s.gd 2018-07-16 03:35:21.679757158 +0100
@@ -0,0 +1,12 @@
+Primary GOT:
+ Canonical gp value: 00008250
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000260 -32752\(gp\) 00000000 Lazy resolver
+ 00000264 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000268 -32744\(gp\) 0000000. 0000000. FUNC UND fun
+ 0000026c -32740\(gp\) 00000000 00000000 OBJECT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375s.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375s.sd 2018-07-16 03:35:21.692844342 +0100
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains 4 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 2. FUNC GLOBAL DEFAULT 5 foo
+ 2: 00000000 0 FUNC WEAK DEFAULT UND fun
+ 3: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-irix.sd 2018-07-16 03:35:21.721068061 +0100
@@ -0,0 +1,8 @@
+Symbol table '\.dynsym' contains 6 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 SECTION GLOBAL PROTECTED ABS _procedure_table_size
+ 2: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_string_table
+ 3: 0000020. 2. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 4: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_table
+ 5: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32-irix.sd 2018-07-16 03:35:21.736167720 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 3. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 2: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32.dd 2018-07-16 03:35:21.765321301 +0100
@@ -0,0 +1,27 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848070 addiu a0,a0,-32656
+ *[0-9a-f]+: 00992021 addu a0,a0,t9
+ *[0-9a-f]+: 24020000 li v0,0
+ *[0-9a-f]+: 24030000 li v1,0
+ *[0-9a-f]+: 24420004 addiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 24630004 addiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848030 addiu a0,a0,-32720
+ *[0-9a-f]+: 00992021 addu a0,a0,t9
+ *[0-9a-f]+: 8882801c lwl v0,-32740\(a0\)
+ *[0-9a-f]+: 9883801c lwr v1,-32740\(a0\)
+ *[0-9a-f]+: 24420004 addiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 24630004 addiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32.gd 2018-07-16 03:35:21.797538397 +0100
@@ -0,0 +1,15 @@
+Primary GOT:
+ Canonical gp value: 00008270
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000280 -32752\(gp\) 00000000 Lazy resolver
+ 00000284 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00000288 -32744\(gp\) 00000000
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 0000028c -32740\(gp\) 00000000 00000000 NOTYPE ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n32.sd 2018-07-16 03:35:21.812994005 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 3. FUNC GLOBAL DEFAULT 5 foo
+ 2: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64-irix.sd 2018-07-16 03:35:21.822096810 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 000000000000020. 3. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 2: 0000000000000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64.dd 2018-07-16 03:35:21.840389065 +0100
@@ -0,0 +1,27 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848070 addiu a0,a0,-32656
+ *[0-9a-f]+: 0099202d daddu a0,a0,t9
+ *[0-9a-f]+: 24020000 li v0,0
+ *[0-9a-f]+: 24030000 li v1,0
+ *[0-9a-f]+: 64420004 daddiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 64630004 daddiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 00800025 move zero,a0
+ *[0-9a-f]+: 3c040001 lui a0,0x1
+ *[0-9a-f]+: 24848030 addiu a0,a0,-32720
+ *[0-9a-f]+: 0099202d daddu a0,a0,t9
+ *[0-9a-f]+: 68828028 ldl v0,-32728\(a0\)
+ *[0-9a-f]+: 6c838028 ldr v1,-32728\(a0\)
+ *[0-9a-f]+: 64420004 daddiu v0,v0,4
+ *[0-9a-f]+: 03e00008 jr ra
+ *[0-9a-f]+: 64630004 daddiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64.gd 2018-07-16 03:35:21.856713311 +0100
@@ -0,0 +1,15 @@
+Primary GOT:
+ Canonical gp value: 0000000000008270
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 0000000000000280 -32752\(gp\) 0000000000000000 Lazy resolver
+ 0000000000000288 -32744\(gp\) 8000000000000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 0000000000000290 -32736\(gp\) 0000000000000000
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 0000000000000298 -32728\(gp\) 0000000000000000 0000000000000000 NOTYPE ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh-n64.sd 2018-07-16 03:35:21.875137285 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 000000000000020. 3. FUNC GLOBAL DEFAULT 5 foo
+ 2: 0000000000000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh.dd 2018-07-16 03:35:21.890487244 +0100
@@ -0,0 +1,23 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 24190000 li t9,0
+ *[0-9a-f]+: 24040000 li a0,0
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8020 addiu gp,gp,-32736
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 8b998020 lwl t9,-32736\(gp\)
+ *[0-9a-f]+: 9b848020 lwr a0,-32736\(gp\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh.gd 2018-07-16 03:35:21.921138150 +0100
@@ -0,0 +1,16 @@
+Primary GOT:
+ Canonical gp value: 00008250
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000260 -32752\(gp\) 00000000 Lazy resolver
+ 00000264 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00000268 -32744\(gp\) 00000000
+ 0000026c -32740\(gp\) 00000000
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000270 -32736\(gp\) 00000000 00000000 NOTYPE ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sh.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sh.sd 2018-07-16 03:35:21.934279804 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 2. FUNC GLOBAL DEFAULT 5 foo
+ 2: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shg-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shg-irix.sd 2018-07-16 03:35:21.940436431 +0100
@@ -0,0 +1,7 @@
+Symbol table '\.dynsym' contains 5 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 SECTION GLOBAL PROTECTED ABS _procedure_table_size
+ 2: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_string_table
+ 3: 00000200 28 FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 4: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_table
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shg.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shg.dd 2018-07-16 03:35:21.948616636 +0100
@@ -0,0 +1,13 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c0001 lui gp,0x1
+ *[0-9a-f]+: 279c8020 addiu gp,gp,-32736
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 24190000 li t9,0
+ *[0-9a-f]+: 24040000 li a0,0
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shg.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shg.gd 2018-07-16 03:35:21.956693297 +0100
@@ -0,0 +1,12 @@
+Primary GOT:
+ Canonical gp value: 00008220
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000230 -32752\(gp\) 00000000 Lazy resolver
+ 00000234 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00000238 -32744\(gp\) 00000000
+ 0000023c -32740\(gp\) 00000000
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shg.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shg.sd 2018-07-16 03:35:21.969824368 +0100
@@ -0,0 +1,4 @@
+Symbol table '\.dynsym' contains 2 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000200 28 FUNC GLOBAL DEFAULT 5 foo
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shl-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shl-irix.sd 2018-07-16 03:35:21.982972985 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000200 28 FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 2: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shl.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shl.gd 2018-07-16 03:35:21.999286319 +0100
@@ -0,0 +1,16 @@
+Primary GOT:
+ Canonical gp value: 00008250
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000260 -32752\(gp\) 00000000 Lazy resolver
+ 00000264 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00000268 -32744\(gp\) 00000000
+ 0000026c -32740\(gp\) 00000000
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000270 -32736\(gp\) 00000000 00000000 NOTYPE ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shl.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shl.sd 2018-07-16 03:35:22.020796872 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000200 28 FUNC GLOBAL DEFAULT 5 foo
+ 2: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shv-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shv-irix.sd 2018-07-16 03:35:22.044297441 +0100
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains 4 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000200 28 FUNC GLOBAL DEFAULT PRC\[0xff01\] foo@@PR21375
+ 2: 00000000 0 OBJECT GLOBAL DEFAULT ABS PR21375
+ 3: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero@@PR21375
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shv.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shv.gd 2018-07-16 03:35:22.070461336 +0100
@@ -0,0 +1,16 @@
+Primary GOT:
+ Canonical gp value: 00008250
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000260 -32752\(gp\) 00000000 Lazy resolver
+ 00000264 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00000268 -32744\(gp\) 00000000
+ 0000026c -32740\(gp\) 00000000
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000270 -32736\(gp\) 00000000 00000000 NOTYPE ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375shv.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375shv.sd 2018-07-16 03:35:22.089566270 +0100
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains 4 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000200 28 FUNC GLOBAL DEFAULT 7 foo@@PR21375
+ 2: 00000000 0 OBJECT GLOBAL DEFAULT ABS PR21375
+ 3: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero@@PR21375
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sm16.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sm16.dd 2018-07-16 03:35:22.111689140 +0100
@@ -0,0 +1,28 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: f000 6a01 li v0,1
+ *[0-9a-f]+: f050 0b0c la v1,ffff8250 <_gp\+0xffff0000>
+ *[0-9a-f]+: f400 3240 sll v0,16
+ *[0-9a-f]+: e269 addu v0,v1
+ *[0-9a-f]+: f010 9a9c lw a0,-32740\(v0\)
+ *[0-9a-f]+: f010 9a58 lw v0,-32744\(v0\)
+ *[0-9a-f]+: ea00 jr v0
+ *[0-9a-f]+: 653a move t9,v0
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: f000 6a01 li v0,1
+ *[0-9a-f]+: f010 0b1c la v1,ffff8250 <_gp\+0xffff0000>
+ *[0-9a-f]+: f400 3240 sll v0,16
+ *[0-9a-f]+: e269 addu v0,v1
+ *[0-9a-f]+: 6782 move a0,v0
+ *[0-9a-f]+: f010 4c1c addiu a0,-32740
+ *[0-9a-f]+: f010 4a18 addiu v0,-32744
+ *[0-9a-f]+: 9a40 lw v0,0\(v0\)
+ *[0-9a-f]+: 9c80 lw a0,0\(a0\)
+ *[0-9a-f]+: ea00 jr v0
+ *[0-9a-f]+: 653a move t9,v0
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sm16h.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sm16h.dd 2018-07-16 03:35:22.126785936 +0100
@@ -0,0 +1,28 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: f000 6a01 li v0,1
+ *[0-9a-f]+: f050 0b0c la v1,ffff8250 <_gp\+0xffff0000>
+ *[0-9a-f]+: f400 3240 sll v0,16
+ *[0-9a-f]+: e269 addu v0,v1
+ *[0-9a-f]+: f000 6c00 li a0,0
+ *[0-9a-f]+: f000 6a00 li v0,0
+ *[0-9a-f]+: ea00 jr v0
+ *[0-9a-f]+: 653a move t9,v0
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: f000 6a01 li v0,1
+ *[0-9a-f]+: f010 0b1c la v1,ffff8250 <_gp\+0xffff0000>
+ *[0-9a-f]+: f400 3240 sll v0,16
+ *[0-9a-f]+: e269 addu v0,v1
+ *[0-9a-f]+: 6782 move a0,v0
+ *[0-9a-f]+: f030 4c00 addiu a0,-32736
+ *[0-9a-f]+: f030 4a00 addiu v0,-32736
+ *[0-9a-f]+: 9a40 lw v0,0\(v0\)
+ *[0-9a-f]+: 9c80 lw a0,0\(a0\)
+ *[0-9a-f]+: ea00 jr v0
+ *[0-9a-f]+: 653a move t9,v0
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375su-n32.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375su-n32.dd 2018-07-16 03:35:22.146899215 +0100
@@ -0,0 +1,29 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 806f addiu a0,a0,-32657
+ *[0-9a-f]+: 0324 2150 addu a0,a0,t9
+ *[0-9a-f]+: fc44 8018 lw v0,-32744\(a0\)
+ *[0-9a-f]+: fc64 8018 lw v1,-32744\(a0\)
+ *[0-9a-f]+: 3042 0004 addiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 6db2 addiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 802f addiu a0,a0,-32721
+ *[0-9a-f]+: 0324 2150 addu a0,a0,t9
+ *[0-9a-f]+: 3024 8018 addiu at,a0,-32744
+ *[0-9a-f]+: 6041 0000 lwl v0,0\(at\)
+ *[0-9a-f]+: 3024 8018 addiu at,a0,-32744
+ *[0-9a-f]+: 6061 1000 lwr v1,0\(at\)
+ *[0-9a-f]+: 3042 0004 addiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 6db2 addiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375su-n64.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375su-n64.dd 2018-07-16 03:35:22.173074597 +0100
@@ -0,0 +1,29 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 806f addiu a0,a0,-32657
+ *[0-9a-f]+: 5b24 2150 daddu a0,a0,t9
+ *[0-9a-f]+: dc44 8020 ld v0,-32736\(a0\)
+ *[0-9a-f]+: dc64 8020 ld v1,-32736\(a0\)
+ *[0-9a-f]+: 5c42 0004 daddiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 5c63 0004 daddiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 802f addiu a0,a0,-32721
+ *[0-9a-f]+: 5b24 2150 daddu a0,a0,t9
+ *[0-9a-f]+: 5c24 8020 daddiu at,a0,-32736
+ *[0-9a-f]+: 6041 4000 ldl v0,0\(at\)
+ *[0-9a-f]+: 5c24 8020 daddiu at,a0,-32736
+ *[0-9a-f]+: 6061 5000 ldr v1,0\(at\)
+ *[0-9a-f]+: 5c42 0004 daddiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 5c63 0004 daddiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375su.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375su.dd 2018-07-16 03:35:22.202556671 +0100
@@ -0,0 +1,25 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 41bc 0001 lui gp,0x1
+ *[0-9a-f]+: 339c 804f addiu gp,gp,-32689
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: ff3c 8018 lw t9,-32744\(gp\)
+ *[0-9a-f]+: fc9c 801c lw a0,-32740\(gp\)
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 41bc 0001 lui gp,0x1
+ *[0-9a-f]+: 339c 801f addiu gp,gp,-32737
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: 303c 8018 addiu at,gp,-32744
+ *[0-9a-f]+: 6321 0000 lwl t9,0\(at\)
+ *[0-9a-f]+: 303c 801c addiu at,gp,-32740
+ *[0-9a-f]+: 6081 1000 lwr a0,0\(at\)
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375suh-n32.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375suh-n32.dd 2018-07-16 03:35:22.232446945 +0100
@@ -0,0 +1,29 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 806f addiu a0,a0,-32657
+ *[0-9a-f]+: 0324 2150 addu a0,a0,t9
+ *[0-9a-f]+: 3040 0000 li v0,0
+ *[0-9a-f]+: 3060 0000 li v1,0
+ *[0-9a-f]+: 3042 0004 addiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 6db2 addiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 802f addiu a0,a0,-32721
+ *[0-9a-f]+: 0324 2150 addu a0,a0,t9
+ *[0-9a-f]+: 3024 801c addiu at,a0,-32740
+ *[0-9a-f]+: 6041 0000 lwl v0,0\(at\)
+ *[0-9a-f]+: 3024 801c addiu at,a0,-32740
+ *[0-9a-f]+: 6061 1000 lwr v1,0\(at\)
+ *[0-9a-f]+: 3042 0004 addiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 6db2 addiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375suh-n64.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375suh-n64.dd 2018-07-16 03:35:22.253034960 +0100
@@ -0,0 +1,29 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 806f addiu a0,a0,-32657
+ *[0-9a-f]+: 5b24 2150 daddu a0,a0,t9
+ *[0-9a-f]+: 3040 0000 li v0,0
+ *[0-9a-f]+: 3060 0000 li v1,0
+ *[0-9a-f]+: 5c42 0004 daddiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 5c63 0004 daddiu v1,v1,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 0c04 move zero,a0
+ *[0-9a-f]+: 41a4 0001 lui a0,0x1
+ *[0-9a-f]+: 3084 802f addiu a0,a0,-32721
+ *[0-9a-f]+: 5b24 2150 daddu a0,a0,t9
+ *[0-9a-f]+: 5c24 8028 daddiu at,a0,-32728
+ *[0-9a-f]+: 6041 4000 ldl v0,0\(at\)
+ *[0-9a-f]+: 5c24 8028 daddiu at,a0,-32728
+ *[0-9a-f]+: 6061 5000 ldr v1,0\(at\)
+ *[0-9a-f]+: 5c42 0004 daddiu v0,v0,4
+ *[0-9a-f]+: 459f jr ra
+ *[0-9a-f]+: 5c63 0004 daddiu v1,v1,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375suh.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375suh.dd 2018-07-16 03:35:22.277837894 +0100
@@ -0,0 +1,25 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 41bc 0001 lui gp,0x1
+ *[0-9a-f]+: 339c 804f addiu gp,gp,-32689
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: 3320 0000 li t9,0
+ *[0-9a-f]+: 3080 0000 li a0,0
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 41bc 0001 lui gp,0x1
+ *[0-9a-f]+: 339c 801f addiu gp,gp,-32737
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: 303c 8020 addiu at,gp,-32736
+ *[0-9a-f]+: 6321 0000 lwl t9,0\(at\)
+ *[0-9a-f]+: 303c 8020 addiu at,gp,-32736
+ *[0-9a-f]+: 6081 1000 lwr a0,0\(at\)
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sux.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sux.dd 2018-07-16 03:35:22.298512924 +0100
@@ -0,0 +1,33 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 41bc 8000 lui gp,0x8000
+ *[0-9a-f]+: 339c 808f addiu gp,gp,-32625
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: 41a4 8000 lui a0,0x8000
+ *[0-9a-f]+: 41b9 8000 lui t9,0x8000
+ *[0-9a-f]+: 0384 2150 addu a0,a0,gp
+ *[0-9a-f]+: 0399 c950 addu t9,t9,gp
+ *[0-9a-f]+: ff39 7ff8 lw t9,32760\(t9\)
+ *[0-9a-f]+: fc84 7ffc lw a0,32764\(a0\)
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 41bc 8000 lui gp,0x8000
+ *[0-9a-f]+: 339c 804f addiu gp,gp,-32689
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: 41a4 8000 lui a0,0x8000
+ *[0-9a-f]+: 41b9 8000 lui t9,0x8000
+ *[0-9a-f]+: 0384 2150 addu a0,a0,gp
+ *[0-9a-f]+: 0399 c950 addu t9,t9,gp
+ *[0-9a-f]+: 3039 7ff8 addiu at,t9,32760
+ *[0-9a-f]+: 6321 0000 lwl t9,0\(at\)
+ *[0-9a-f]+: 3024 7ffc addiu at,a0,32764
+ *[0-9a-f]+: 6081 1000 lwr a0,0\(at\)
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375suxh.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375suxh.dd 2018-07-16 03:35:22.314947032 +0100
@@ -0,0 +1,33 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 41bc 8000 lui gp,0x8000
+ *[0-9a-f]+: 339c 808f addiu gp,gp,-32625
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: 41a4 8001 lui a0,0x8001
+ *[0-9a-f]+: 41b9 8001 lui t9,0x8001
+ *[0-9a-f]+: 0384 2150 addu a0,a0,gp
+ *[0-9a-f]+: 0399 c950 addu t9,t9,gp
+ *[0-9a-f]+: 3320 0000 li t9,0
+ *[0-9a-f]+: 3080 0000 li a0,0
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 41bc 8000 lui gp,0x8000
+ *[0-9a-f]+: 339c 804f addiu gp,gp,-32689
+ *[0-9a-f]+: 033c e150 addu gp,gp,t9
+ *[0-9a-f]+: 41a4 8001 lui a0,0x8001
+ *[0-9a-f]+: 41b9 8001 lui t9,0x8001
+ *[0-9a-f]+: 0384 2150 addu a0,a0,gp
+ *[0-9a-f]+: 0399 c950 addu t9,t9,gp
+ *[0-9a-f]+: 3039 8000 addiu at,t9,-32768
+ *[0-9a-f]+: 6321 0000 lwl t9,0\(at\)
+ *[0-9a-f]+: 3024 8000 addiu at,a0,-32768
+ *[0-9a-f]+: 6081 1000 lwr a0,0\(at\)
+ *[0-9a-f]+: 4599 jr t9
+ *[0-9a-f]+: 6e42 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sx-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sx-irix.sd 2018-07-16 03:35:22.332508606 +0100
@@ -0,0 +1,9 @@
+Symbol table '\.dynsym' contains 7 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 SECTION GLOBAL PROTECTED ABS _procedure_table_size
+ 2: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_string_table
+ 3: 0000020. 4. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 4: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_table
+ 5: 00000000 0 FUNC WEAK DEFAULT UND fun
+ 6: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sx.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sx.dd 2018-07-16 03:35:22.342789328 +0100
@@ -0,0 +1,31 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c8000 lui gp,0x8000
+ *[0-9a-f]+: 279c8090 addiu gp,gp,-32624
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 3c048000 lui a0,0x8000
+ *[0-9a-f]+: 3c198000 lui t9,0x8000
+ *[0-9a-f]+: 009c2021 addu a0,a0,gp
+ *[0-9a-f]+: 033cc821 addu t9,t9,gp
+ *[0-9a-f]+: 8f397ff8 lw t9,32760\(t9\)
+ *[0-9a-f]+: 8c847ffc lw a0,32764\(a0\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c8000 lui gp,0x8000
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 3c048000 lui a0,0x8000
+ *[0-9a-f]+: 3c198000 lui t9,0x8000
+ *[0-9a-f]+: 009c2021 addu a0,a0,gp
+ *[0-9a-f]+: 033cc821 addu t9,t9,gp
+ *[0-9a-f]+: 8b397ff8 lwl t9,32760\(t9\)
+ *[0-9a-f]+: 98847ffc lwr a0,32764\(a0\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sx.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sx.gd 2018-07-16 03:35:22.358268143 +0100
@@ -0,0 +1,12 @@
+Primary GOT:
+ Canonical gp value: 00008270
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000280 -32752\(gp\) 00000000 Lazy resolver
+ 00000284 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000288 -32744\(gp\) 0000000. 0000000. FUNC UND fun
+ 0000028c -32740\(gp\) 00000000 00000000 OBJECT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sx.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sx.sd 2018-07-16 03:35:22.373651461 +0100
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains 4 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 4. FUNC GLOBAL DEFAULT 5 foo
+ 2: 00000000 0 FUNC WEAK DEFAULT UND fun
+ 3: 00000000 0 OBJECT WEAK DEFAULT UND obj
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sxh-irix.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sxh-irix.sd 2018-07-16 03:35:22.396327251 +0100
@@ -0,0 +1,8 @@
+Symbol table '\.dynsym' contains 6 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 SECTION GLOBAL PROTECTED ABS _procedure_table_size
+ 2: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_string_table
+ 3: 0000020. 4. FUNC GLOBAL DEFAULT PRC\[0xff01\] foo
+ 4: 00000000 0 SECTION GLOBAL PROTECTED PRC\[0xff02\] _procedure_table
+ 5: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sxh.dd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sxh.dd 2018-07-16 03:35:22.417914211 +0100
@@ -0,0 +1,31 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+
+[0-9a-f]+ <foo>:
+ *[0-9a-f]+: 3c1c8000 lui gp,0x8000
+ *[0-9a-f]+: 279c8090 addiu gp,gp,-32624
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 3c048001 lui a0,0x8001
+ *[0-9a-f]+: 3c198001 lui t9,0x8001
+ *[0-9a-f]+: 009c2021 addu a0,a0,gp
+ *[0-9a-f]+: 033cc821 addu t9,t9,gp
+ *[0-9a-f]+: 24190000 li t9,0
+ *[0-9a-f]+: 24040000 li a0,0
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: 3c1c8000 lui gp,0x8000
+ *[0-9a-f]+: 279c8050 addiu gp,gp,-32688
+ *[0-9a-f]+: 0399e021 addu gp,gp,t9
+ *[0-9a-f]+: 3c048001 lui a0,0x8001
+ *[0-9a-f]+: 3c198001 lui t9,0x8001
+ *[0-9a-f]+: 009c2021 addu a0,a0,gp
+ *[0-9a-f]+: 033cc821 addu t9,t9,gp
+ *[0-9a-f]+: 8b398000 lwl t9,-32768\(t9\)
+ *[0-9a-f]+: 98848000 lwr a0,-32768\(a0\)
+ *[0-9a-f]+: 03200008 jr t9
+ *[0-9a-f]+: 24840004 addiu a0,a0,4
+ \.\.\.
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sxh.gd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sxh.gd 2018-07-16 03:35:22.428237750 +0100
@@ -0,0 +1,16 @@
+Primary GOT:
+ Canonical gp value: 00008270
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00000280 -32752\(gp\) 00000000 Lazy resolver
+ 00000284 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00000288 -32744\(gp\) 00000000
+ 0000028c -32740\(gp\) 00000000
+
+ Global entries:
+ Address Access Initial Sym\.Val\. Type Ndx Name
+ 00000290 -32736\(gp\) 00000000 00000000 NOTYPE ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375sxh.sd
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375sxh.sd 2018-07-16 03:35:22.436485973 +0100
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains 3 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000020. 4. FUNC GLOBAL DEFAULT 5 foo
+ 2: 00000000 0 NOTYPE GLOBAL PROTECTED ABS __gnu_absolute_zero
Index: binutils/ld/testsuite/ld-mips-elf/pr21375v.ver
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils/ld/testsuite/ld-mips-elf/pr21375v.ver 2018-07-16 03:35:22.452813534 +0100
@@ -0,0 +1 @@
+PR21375 { global: foo; local: *; };
Maciej W. Rozycki
2018-09-14 19:35:37 UTC
Permalink
Post by Maciej W. Rozycki
This has been regression-tested with my usual MIPS targets. I will leave
these changes waiting for 24 hours before I commit them, and will be happy
to accept feedback during that time.
The blocker issue has been fixed, so I have now applied this series and
closed PR ld/21375.

Maciej

Loading...