From f0c12b73402e181fed2ac4e3911f8754004d08e6 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Mon, 9 Sep 1996 22:59:40 +0000 Subject: [PATCH] * config.bfd,configure.in,configure: Add m32r support. * Makefile.in,archures.c,elf.c,targets.c: Likewise. --- bfd/.Sanitize | 2 +- bfd/ChangeLog | 1 + bfd/Makefile.in | 38 ++++++++++++++++++++++++++++++++++---- bfd/elf.c | 36 +++++++++++++++++++++++++++++------- 4 files changed, 65 insertions(+), 12 deletions(-) diff --git a/bfd/.Sanitize b/bfd/.Sanitize index 668f47c5561..78022f8a93c 100644 --- a/bfd/.Sanitize +++ b/bfd/.Sanitize @@ -333,7 +333,7 @@ else done fi -m32r_files="ChangeLog config.bfd configure.in configure" +m32r_files="ChangeLog Makefile.in archures.c config.bfd configure.in configure elf.c targets.c" if ( echo $* | grep keep\-m32r > /dev/null ) ; then for i in $m32r_files ; do if test ! -d $i && (grep sanitize-m32r $i > /dev/null) ; then diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 22bc29216dc..f59a7e581a0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -2,6 +2,7 @@ Mon Sep 9 12:31:22 1996 Doug Evans start-sanitize-m32r * config.bfd,configure.in,configure: Add m32r support. + * Makefile.in,archures.c,elf.c,targets.c: Likewise. end-sanitize-m32r * config.bfd: Keep target list alphabetically sorted. diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 01efdc63ad4..7a607114d27 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -125,6 +125,9 @@ ALL_MACHINES = \ cpu-i386.o \ cpu-i860.o \ cpu-i960.o \ + $(start-sanitize-m32r) \ + cpu-m32r.o \ + $(end-sanitize-m32r) \ cpu-m68k.o \ cpu-m88k.o \ cpu-mips.o \ @@ -133,6 +136,9 @@ ALL_MACHINES = \ cpu-rs6000.o \ cpu-sh.o \ cpu-sparc.o \ + $(start-sanitize-v850) \ + cpu-v850.o \ + $(end-sanitize-v850) \ cpu-vax.o \ cpu-we32k.o \ cpu-w65.o \ @@ -206,10 +212,14 @@ BFD32_BACKENDS = \ elf32-hppa.o \ elf32-i386.o \ elf32-i860.o \ + $(start-sanitize-m32r) \ + elf32-m32r.o \ + $(end-sanitize-m32r) \ elf32-m68k.o \ elf32-m88k.o \ elf32-mips.o \ elf32-ppc.o \ + elf32-sh.o \ elf32-sparc.o \ elf32.o \ elflink.o \ @@ -295,6 +305,7 @@ BFD32_BACKENDS_CFILES = \ elf32-m88k.c \ elf32-mips.c \ elf32-ppc.c \ + elf32-sh.c \ elf32-sparc.c \ elf32.c \ elflink.c \ @@ -808,6 +819,19 @@ elf32-d10v.o: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/d10v.h elf32-target.h end-sanitize-d10v: +start-sanitize-m32r: +elf32-m32r.o: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/m32r.h elf32-target.h +end-sanitize-m32r: + +start-sanitize-v850: +cpu-v850.o: cpu-v850.c +elf32-v850.o: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + elf32-target.h +end-sanitize-v850: + $(OFILES): stamp-picdir stamp-picdir: @@ -875,6 +899,9 @@ aout-adobe.o: aout-adobe.c $(INCDIR)/aout/adobe.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def libaout.h $(INCDIR)/bfdlink.h aout-ns32k.o: aout-ns32k.c $(INCDIR)/aout/aout64.h \ ns32k.h libaout.h $(INCDIR)/bfdlink.h +aout-sparcle.o: aout-sparcle.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ + $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h aout0.o: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h @@ -981,6 +1008,9 @@ elf32-mips.o: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \ elf32-ppc.o: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/elf/ppc.h elf32-target.h +elf32-sh.o: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + elf32-target.h elf32-sparc.o: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/elf/sparc.h elf32-target.h @@ -994,8 +1024,8 @@ hp300hpux.o: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ aout-target.h som.o: som.c -i386aout.o: i386aout.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ +i386aout.o: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h i386bsd.o: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ @@ -1109,8 +1139,8 @@ elf64-alpha.o: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \ elf64-gen.o: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf64-target.h -elf64-mips.o: elf64-mips.c $(INCDIR)/bfdlink.h genlink.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ +elf64-mips.o: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \ + genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \ $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \ diff --git a/bfd/elf.c b/bfd/elf.c index 49789578333..dd5527f1e9f 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -212,6 +212,15 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) || strncmp (name, ".stab", sizeof ".stab" - 1) == 0) flags |= SEC_DEBUGGING; + /* As a GNU extension, if the name begins with .gnu.linkonce, we + only link a single copy of the section. This is used to support + g++. g++ will emit each template expansion in its own section. + The symbols will be defined as weak, so that multiple definitions + are permitted. The GNU linker extension is to actually discard + all but one of the sections. */ + if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) + flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; + if (! bfd_set_section_flags (abfd, newsect, flags)) return false; @@ -1779,13 +1788,6 @@ map_sections_to_segments (abfd) segment. */ new_segment = true; } - else if ((abfd->flags & D_PAGED) == 0) - { - /* If the file is not demand paged, which means that we - don't require the sections to be correctly aligned in the - file, then there is no other reason for a new segment. */ - new_segment = false; - } else if (BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, maxpagesize) < hdr->lma) { @@ -1793,6 +1795,13 @@ map_sections_to_segments (abfd) skip a page in the segment, then we need a new segment. */ new_segment = true; } + else if ((abfd->flags & D_PAGED) == 0) + { + /* If the file is not demand paged, which means that we + don't require the sections to be correctly aligned in the + file, then there is no other reason for a new segment. */ + new_segment = false; + } else if ((last_hdr->flags & SEC_LOAD) == 0 && (hdr->flags & SEC_LOAD) != 0) { @@ -2487,16 +2496,29 @@ prep_headers (abfd) case bfd_arch_alpha: i_ehdrp->e_machine = EM_ALPHA; break; + case bfd_arch_sh: + i_ehdrp->e_machine = EM_SH; + break; /* start-sanitize-d10v */ case bfd_arch_d10v: i_ehdrp->e_machine = EM_CYGNUS_D10V; break; /* end-sanitize-d10v */ +/* start-sanitize-v850 */ + case bfd_arch_v850: + i_ehdrp->e_machine = EM_CYGNUS_V850; + break; +/* end-sanitize-v850 */ /* start-sanitize-arc */ case bfd_arch_arc: i_ehdrp->e_machine = EM_CYGNUS_ARC; break; /* end-sanitize-arc */ +/* start-sanitize-m32r */ + case bfd_arch_m32r: + i_ehdrp->e_machine = EM_CYGNUS_M32R; + break; +/* end-sanitize-m32r */ /* also note that EM_M32, AT&T WE32100 is unknown to bfd */ default: i_ehdrp->e_machine = EM_NONE; -- 2.30.2