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: H8300-elf-as DWARF problem preliminary analysis


I hereby submit the final patch.

*** binutils-2.12/gas/config/tc-h8300.h Fri Aug 31 23:13:52 2001
--- modified/gas/config/tc-h8300.h       Mon Aug 19 11:39:08 2002
***************
*** 26,31 ****
--- 26,36 ----

  #define TARGET_ARCH bfd_arch_h8300

+ #ifdef BFD_ASSEMBLER
+ /* Fixup debug sections since we will never relax them.  */
+ #define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC)
+ #endif
+
  #ifdef OBJ_ELF
  #define TARGET_FORMAT "elf32-h8300"
  #endif


I have enabled this check only when BFD_ASSEMBLER is defined
because of two reasons:
	- segT is define as the expected only when 
	  BFD_ASSEMBLER is defined. If BDF_ASSEMBLER
	  is undefined it is defined as enum. (gas/as.h)
	- This has been picked form tc-mn10300.h which
	  I think only build when BFD_ASSEMBLER is defined. 
	  Please consider following slice of tc-mn10300.h

$ head -30 binutils-2.12/gas/config/tc-mn10300.h | tail -6
#ifndef BFD_ASSEMBLER
 #error MN10300 support requires BFD_ASSEMBLER
#endif

/* The target BFD architecture.  */
#define TARGET_ARCH bfd_arch_mn10300


$ head -42 binutils-2.12/gas/config/tc-mn10300.h | tail -2
/* Fixup debug sections since we will never relax them.  */
#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC)

Is this patch OK? 
I have executed make check of GCC after rebuilding
the toolchain with this patch. The result seems to
be ok.

Thanks for your help.

Best Regards,
Nitin



>  >
>  >> Thinking more about this, why wasn't this fixup simplified?
>  >> 
>  >> ie, the generic parts of gas know how to simplify a fixup 
> involving
>  >> the difference of two symbols in the same segment.
>  >> 
>  >> I think the answer is that we don't do fixup 
> simplifications on parts
>  >> where the linker is going to potentially relax the segment (shrink
>  >> the segment).
>  >> 
>  >> You might look look at defining TC_LINKRELAX_FIXUP since 
> I believe the
>  >> fixup you need simplified is in a debugging section.  I 
> believe you
>  >> can find a suitable example in tc-mn10300.c.
>  >> 
>  >Big THANKS for your help. This fixes the problem at the root. Now
>  >fixup simplification is done for debug sections. I copied following
>  >line from tc-mn10300.h to tc-h8300.h
>  >
>  >/* Fixup debug sections since we will never relax them.  */
>  >#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC)
>  >
>  >I think I should localize the change by doing something
>  >like:
>  >#ifdef BFD_ASSEMBLER
>  >#define TC_LINKRELAX_FIXUP(seg) (!DEBUG_SECTION(seg))
>  >#endif
>  >
>  >and define DEBUG_SECTION appropriately.
> I'd just stick with the version you found in tc-mn10300.h.  No need to
> have two different definitions of the same thing floating around.
> 


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