public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] cr16-elf target: discard linkonce sections
@ 2009-09-08 12:32 M R Swami Reddy
  2009-09-08 13:41 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: M R Swami Reddy @ 2009-09-08 12:32 UTC (permalink / raw)
  To: binutils

Hi,
Below patch included in elf32-cr16.c:elf32_cr16_relocate_section to 
discard the linkonce sections:
Ran "make check-gas", "make check-binutils" and make check-ld". No 
regression and 2 linkonce tests
passed from ld test suite. Is it ok for check-in?

ChangeLog:
    M R Swami Reddy <MR.Swami.Reddy@nsc.com>

       * elf32-cr16.c (elf32_cr16_relocate_section): Add code to discard the
       linkonce or linker script discarded section.


Index: elf32-cr16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16.c,v
retrieving revision 1.9
diff -u -r1.9 elf32-cr16.c
--- elf32-cr16.c        2 Sep 2009 07:18:36 -0000       1.9
+++ elf32-cr16.c        8 Sep 2009 12:27:50 -0000
@@ -1473,6 +1473,20 @@
                                    unresolved_reloc, warned);
         }

+      if (sec != NULL && elf_discarded_section (sec))
+       {
+         /* For relocs against symbols from removed linkonce sections,
+            or sections discarded by a linker script, we just want the
+            section contents zeroed.  Avoid any special processing.  */
+         _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
+         rel->r_info = 0;
+         rel->r_addend = 0;
+         continue;
+       }
+
+      if (info->relocatable)
+        continue;
+
       r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd,
                                         input_section,
                                         contents, rel->r_offset,







^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] cr16-elf target: discard linkonce sections
  2009-09-08 12:32 [patch] cr16-elf target: discard linkonce sections M R Swami Reddy
@ 2009-09-08 13:41 ` Nick Clifton
  2009-09-09  4:51   ` M R Swami Reddy
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2009-09-08 13:41 UTC (permalink / raw)
  To: M R Swami Reddy; +Cc: binutils

Hi Swami,

> Below patch included in elf32-cr16.c:elf32_cr16_relocate_section to 
> discard the linkonce sections:
> Ran "make check-gas", "make check-binutils" and make check-ld". No 
> regression and 2 linkonce tests
> passed from ld test suite. Is it ok for check-in?

Approved - although since this is a patch to a CR16 specific file and 
you are the maintainer you do not really need to seek approval.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] cr16-elf target: discard linkonce sections
  2009-09-08 13:41 ` Nick Clifton
@ 2009-09-09  4:51   ` M R Swami Reddy
  0 siblings, 0 replies; 3+ messages in thread
From: M R Swami Reddy @ 2009-09-09  4:51 UTC (permalink / raw)
  To: Nick Clifton, binutils

Hi Nick,
> Approved - although since this is a patch to a CR16 specific file and 
> you are the maintainer you do not really need to seek approval.
OK, thanks. Applied the changes.

Thanks
Swami

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-09  4:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-08 12:32 [patch] cr16-elf target: discard linkonce sections M R Swami Reddy
2009-09-08 13:41 ` Nick Clifton
2009-09-09  4:51   ` M R Swami Reddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).