]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/binutils/binutils-2.15.91.0.2/sec_link_duplicates_same_contents.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / binutils / binutils-2.15.91.0.2 / sec_link_duplicates_same_contents.patch
1 ===================================================================
2 RCS file: /cvs/src/src/bfd/elflink.c,v
3 retrieving revision 1.97
4 retrieving revision 1.98
5 diff -u -r1.97 -r1.98
6 --- src/bfd/elflink.c   2004/08/18 02:45:42     1.97
7 +++ src/bfd/elflink.c   2004/08/21 01:13:22     1.98
8 @@ -9366,6 +9366,36 @@
9                   (_("%B: duplicate section `%A' has different size\n"),
10                    abfd, sec);
11               break;
12 +
13 +           case SEC_LINK_DUPLICATES_SAME_CONTENTS:
14 +             if (sec->size != l->sec->size)
15 +               (*_bfd_error_handler)
16 +                 (_("%B: duplicate section `%A' has different size\n"),
17 +                  abfd, sec);
18 +             else if (sec->size != 0)
19 +               {
20 +                 bfd_byte *sec_contents, *l_sec_contents;
21 +
22 +                 if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
23 +                   (*_bfd_error_handler)
24 +                     (_("%B: warning: could not read contents of section `%A'\n"),
25 +                      abfd, sec);
26 +                 else if (!bfd_malloc_and_get_section (l->sec->owner, l->sec,
27 +                                                       &l_sec_contents))
28 +                   (*_bfd_error_handler)
29 +                     (_("%B: warning: could not read contents of section `%A'\n"),
30 +                      l->sec->owner, l->sec);
31 +                 else if (memcmp (sec_contents, l_sec_contents, sec->size) != 0)
32 +                   (*_bfd_error_handler)
33 +                     (_("%B: warning: duplicate section `%A' has different contents\n"),
34 +                      abfd, sec);
35 +
36 +                 if (sec_contents)
37 +                   free (sec_contents);
38 +                 if (l_sec_contents)
39 +                   free (l_sec_contents);
40 +               }
41 +             break;
42             }
43  
44           /* Set the output_section field so that lang_add_section