This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS assembler no longer "combines symbols in different segments"...


David Daney wrote:
A recent change to gas seems to have broken it so that it no longer works with gcc-3.3. Configured as target=mipsel-linux

The .eh_frame code generated by gcc-3.3 contains things like this:

.4byte $LFB2-.

Where '$LFB2' is in .text and '.' is in .eh_frame. This worked well in 2.15 but for:

$ mipsel-linux-as --version
GNU assembler 050218 20050218

I am getting:

Error: operation combines symbols in different segments

for this.

Is there a good reason that this was changed?

If not can we change it back?

There are enough ld bugs in 2.15 that I want to use this snapshot, but I will probably have to resolve this issue first.

David Daney.

This patch seems like it caused this problem:


[ bfd/ChangeLog ]
2004-04-28  Chris Demetriou  <cgd@broadcom.com>

	* reloc.c: Remove BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Likewise.

[ gas/ChangeLog ]
2004-04-28  Chris Demetriou  <cgd@broadcom.com>

	* config/tc-mips.c (HAVE_32BIT_ADDRESSES, append_insn, macro_build)
	(load_address, macro, mips_ip, md_parse_option)
	(mips_force_relocation, mips_validate_fix, md_apply_fix3)
	(s_change_sec, pic_need_relax, tc_gen_reloc): Remove all
	embedded-PIC handling, and update comments.
	(SWITCH_TABLE): Remove.
	* config/tc-mips.h (DIFF_EXPR_OK): Delete.
	(enum mips_pic_level): Remove EMBEDDED_PIC.
	(EXTERN_FORCE_RELOC): Remove embedded-PIC handling.
	(TC_FORCE_RELOCATION): Update comment.
	* ecoff.c (ecoff_build_lineno): Add comment about some code that
	might be safe to remove now that MIPS embedded-PIC is gone.


The attached patch was tested with make -k check no regressions and gets back to the behavior I want. But I will also do a little more testing before giving it my whole hearted endorsement.


2005-02-35 David Daney <ddaney@avtrex.com>

        * config/tc-mips.h: #define DIFF_EXPR_OK.
        * config/tc-mips.c (md_apply_fix3): Remove assert (!fixP->fx_pcrel)
        because DIFF_EXPR_OK generates them.
        (tc_gen_reloc) : Ditto.


Thoughts or opinions?


David Daney.



diff -rcp binutils_reference/binutils-050218/gas/config/tc-mips.c binutils-050218/gas/config/tc-mips.c
*** binutils_reference/binutils-050218/gas/config/tc-mips.c	2005-02-17 05:46:04.000000000 -0800
--- binutils-050218/gas/config/tc-mips.c	2005-02-25 15:35:28.000000000 -0800
*************** md_apply_fix3 (fixS *fixP, valueT *valP,
*** 11018,11025 ****
  
    buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where);
  
-   assert (! fixP->fx_pcrel);
- 
    /* Don't treat parts of a composite relocation as done.  There are two
       reasons for this:
  
--- 11018,11023 ----
*************** md_apply_fix3 (fixS *fixP, valueT *valP,
*** 11065,11071 ****
      case BFD_RELOC_MIPS16_GPREL:
      case BFD_RELOC_MIPS16_HI16:
      case BFD_RELOC_MIPS16_HI16_S:
-       assert (! fixP->fx_pcrel);
        /* Nothing needed to do. The value comes from the reloc entry */
        break;
  
--- 11063,11068 ----
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 12846,12852 ****
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
    reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
  
-   assert (! fixp->fx_pcrel);
    reloc->addend = fixp->fx_addnumber;
  
    /* Since the old MIPS ELF ABI uses Rel instead of Rela, encode the vtable
--- 12843,12848 ----
Only in binutils-050218/gas/config: tc-mips.c~
diff -rcp binutils_reference/binutils-050218/gas/config/tc-mips.h binutils-050218/gas/config/tc-mips.h
*** binutils_reference/binutils-050218/gas/config/tc-mips.h	2004-04-28 22:14:22.000000000 -0700
--- binutils-050218/gas/config/tc-mips.h	2005-02-25 15:52:23.051225506 -0800
*************** extern void mips_handle_align (struct fr
*** 58,63 ****
--- 58,68 ----
  
  #define MAX_MEM_FOR_RS_ALIGN_CODE  (1 + 2)
  
+ /* We permit PC relative difference expressions because gcc used to
+    generate them in .eh_frame sections.  */
+ #define DIFF_EXPR_OK
+ 
+ 
  /* Tell assembler that we have an itbl_mips.h header file to include.  */
  #define HAVE_ITBL_CPU
  
Only in binutils-050218/gas/config: tc-mips.h~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]