From a841bdf5d3bfb9c687f938be7388597db2e461de Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 18 Oct 2014 11:10:53 +1030 Subject: Fix PR17493, attempted output of *GAS `reg' section* symbol The write.c change is to make gas report an error if reg_section symbols should leak in future. The tc-i386.c change is the real fix. Note that the error isn't the most helpful, "redefined symbol cannot be used on reloc", but I'm not inclined to improve what is really an internal gas error. reg_section symbols shouldn't leak.. gas/ PR 17493 * write.c (adjust_reloc_syms): Don't allow symbols in reg_section to be reduced to reg_section section symbol. * gas/config/tc-i386.c (i386_finalize_immediate): Reject all reg_section immediates. gas/testsuite/ * gas/i386/inval-equ-2.l: Adjust. --- gas/write.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gas/write.c') diff --git a/gas/write.c b/gas/write.c index 263b002..0f82d47 100644 --- a/gas/write.c +++ b/gas/write.c @@ -836,7 +836,8 @@ adjust_reloc_syms (bfd *abfd ATTRIBUTE_UNUSED, if (symsec == NULL) abort (); - if (bfd_is_abs_section (symsec)) + if (bfd_is_abs_section (symsec) + || symsec == reg_section) { /* The fixup_segment routine normally will not use this symbol in a relocation. */ -- cgit v1.1