This is the mail archive of the binutils@sourceware.org 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: [PATCH] Avoid R_IA64_NONE relocations when relaxing


On Wed, Aug 03, 2005 at 11:12:22AM -0700, H. J. Lu wrote:
> On Tue, Aug 02, 2005 at 05:25:19PM +0200, Andreas Schwab wrote:
> > Nearly half of the dynamic relocation in libc.so.6.1 are R_IA64_NONE
> > relocation.  With this patch all of them are elided.  Tested on ia64-linux
> > and sucessfully built and tested glibc with it.
> > 
> > Andreas.
> > 
> > 2005-08-02  Andreas Schwab  <schwab@suse.de>
> > 
> > 	* elfxx-ia64.c (struct elfNN_ia64_allocate_data): Add only_got.
> > 	(elfNN_ia64_relax_section): Reallocate .rela.got when .got has
> > 	changed.
> > 	(allocate_dynrel_entries): Only look at GOT relocations when
> > 	only_got is true.
> > 	(elfNN_ia64_size_dynamic_sections): Set only_got to false before
> > 	calling allocate_dynrel_entries.
> > 
> > --- bfd/elfxx-ia64.c.~1.169.~	2005-07-11 10:07:03.000000000 +0200
> > +++ bfd/elfxx-ia64.c	2005-08-02 15:53:14.000000000 +0200
> > @@ -172,6 +172,7 @@ struct elfNN_ia64_allocate_data
> >  {
> >    struct bfd_link_info *info;
> >    bfd_size_type ofs;
> > +  bfd_boolean only_got;
> >  };
> >  
> >  #define elfNN_ia64_hash_table(p) \
> > @@ -1337,7 +1338,17 @@ elfNN_ia64_relax_section (abfd, sec, lin
> >        elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data);
> >        ia64_info->got_sec->size = data.ofs;
> >  
> > -      /* ??? Resize .rela.got too.  */
> > +      if (ia64_info->root.dynamic_sections_created)
> > +	{
> > +	  /* Resize .rela.got.  */
> > +	  ia64_info->rel_got_sec->size = 0;
> 
> ia64_info->rel_got_sec can be NULL if its size is 0. It happens on
> RHEL 3 during "make check":
> 
> FAIL: vers3
> FAIL: vers4
> FAIL: vers6
> FAIL: vers15
> FAIL: vers16
> FAIL: vers19
> FAIL: vers23d
> FAIL: vers23
> FAIL: ELF weak func first
> FAIL: ELF weak func last
> FAIL: ELF weak data first
> FAIL: ELF weak data last
> FAIL: ELF weak data first common
> FAIL: ELF weak data last common
> 
> 
> This patch seems to work for me.
> 
> 

I got

./.libs/libgcj0_convenience.a(DefaultRGBChooserPanel.o): In function
`javax::swing::colorchooser::DefaultRGBChooserPanel::getDisplayName()':
/net/gnu-13/export/gnu/src/gcc-4.0/gcc/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java:173:
relocation truncated to fit: GPREL22 against `.data.rel.local'
./.libs/libgcj0_convenience.a(DefaultRGBChooserPanel.o): In function
`javax::swing::colorchooser::DefaultRGBChooserPanel::buildChooser()':
/net/gnu-13/export/gnu/src/gcc-4.0/gcc/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java:222:
relocation truncated to fit: GPREL22 against `.data.rel.local'
ld: final link failed: Nonrepresentable section on output

when building gcc 4.0 on RHEL 3/4. That relocations used to be
R_IA64_LTOFF22X. Disable the patch fixes the problem.



H.J.


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