bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GAS m68k-aout relocation bug ?


From: Nick Clifton
Subject: Re: GAS m68k-aout relocation bug ?
Date: Tue, 27 Jan 2004 17:06:50 +0000
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux)

Hi Patrice,

> This is a reply to this thread:
> http://mail.gnu.org/archive/html/bug-binutils/2003-11/msg00018.html

> The symbol is (wrongly, I think) processed with lines 2765-2776:
>
>   else if (add_symbol_segment != undefined_section
> #ifdef BFD_ASSEMBLER
>     && ! bfd_is_com_section (add_symbol_segment)
> #endif
>     && MD_APPLY_SYM_VALUE (fixP)) {
>       add_number += S_GET_VALUE (fixP->fx_addsy);
>     }
>   }
>
> instead of lines 2755-2765 (which is the code adapted from binutils-2.13.2.1):
>
>   else if (add_symbol_segment == absolute_section
>     && !TC_FORCE_RELOCATION_ABS (fixP)) {
>       add_number += S_GET_VALUE (fixP->fx_addsy);
>       fixP->fx_offset = add_number;
>       fixP->fx_addsy = NULL;
>   } else ...

Well this implies a patch like the one below might be what you want.

I do not think that this is the correct solution to the problem
however, since it stops all relocations being made against absolute
symbols.

A better solution I feel would be to issue a warning message when the
reloc is generated so that the programmer can check the code to see if
they are using a symbol before it is defined.  You should be able to
do this in md_apply_fix3().

Cheers
        Nick

Index: gas/config/tc-m68k.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.h,v
retrieving revision 1.15
diff -c -3 -p -r1.15 tc-m68k.h
*** gas/config/tc-m68k.h        26 Jan 2004 18:09:30 -0000      1.15
--- gas/config/tc-m68k.h        27 Jan 2004 17:03:41 -0000
*************** extern int tc_m68k_regname_to_dw2regnum 
*** 235,237 ****
--- 235,241 ----
  
  #define tc_cfi_frame_initial_instructions tc_m68k_frame_initial_instructions
  extern void tc_m68k_frame_initial_instructions (void);
+ 
+ #ifdef OBJ_AOUT
+ #define TC_FORCE_RELOCATION_ABS(FIX)   0
+ #endif
        





reply via email to

[Prev in Thread] Current Thread [Next in Thread]