From raeburn@cygnus.com Fri Jan 3 17:47:00 1997 From: raeburn@cygnus.com (Ken Raeburn) Date: Fri, 03 Jan 1997 17:47:00 -0000 Subject: snapshot status Message-ID: <9701040147.AA31724@cujo.cygnus.com> Due to some recent firewall changes at Cygnus, the snapshots aren't being copied to our ftp server. I'll be at our main office next week, and hope to deal with the sysadmins then and find a solution to this problem. Otherwise, we may have to look into moving the ftp site. Ken From robertl@dgii.com Wed Jan 8 10:43:00 1997 From: robertl@dgii.com (Robert Lipe) Date: Wed, 08 Jan 1997 10:43:00 -0000 Subject: emulation on i386-coff, i386-elf patches Message-ID: I have a need for an assembler that can switch between generating i386-elf and i386-coff. Since the gas doco hints that the emulation stuff is desirable, but not fully implemented, I decided to take one stab at it. Once finished, this would surely be desirable in, say, Linux, where it's common to need to flip between the two targets. The attached patches probably break non-bfd COFF targets and should not be applied by anyone not willing to slog around in the code a little bit. If someone that really understands BFD is willing to work with me a little bit on this, I think it will be useful. I did most of my testing on progressive-96q4 code. I did apply the stuff to the 1217 snaps on ftp.cygnus.com:/private/jelly. All I had to change was to add the frob_file_after_relocs vector into the middle of the format_ops structure. I can switch between the two modes with --em=i386coff [ default ]and --em=i386elf. I see that it does the right thing in switching around the recognized pseudo ops and it generates .o's recognized correctly by file. The ELF .o of "hello, world" world even links and runs. However, the COFF version has a problem that isn't obvious to me. Here is a disassembly of the same .s file generated with the native COFF assembler and with this assembler in COFF mode. $ dis x.o | tail main 0: eb 0d jmp 0xd 2: 68 00 00 00 00 pushl $0x0 7: e8 fc ff ff ff call 0xfffffffc <8> c: 59 popl %ecx d: c9 leave e: c3 ret f: 55 pushl %ebp 10: 8b ec movl %esp,%ebp 12: eb ee jmp 0xee <2> (robertl) pento:/home/robertl/tmp/c/x/gas $ dis x.gas.o | tail main 0: eb 0d jmp 0xd 2: 68 00 00 00 00 pushl $0x0 7: e8 04 00 00 00 call 0x4 <10> c: 59 popl %ecx d: c9 leave e: c3 ret f: 55 pushl %ebp 10: 89 e5 movl %esp,%ebp 12: eb ee jmp 0xee <2> Clearly, the call to printf is very different, and it's distrubing that one of them is -4 and the other one is 4. Can anyone work with me on getting this stuff hammered into a usable form? Thanx, RJL --- gas/Makefile.in_ Mon Aug 19 17:26:40 1996 +++ gas/Makefile.in Wed Jan 8 10:11:15 1997 @@ -390,11 +390,18 @@ $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c obj-ecoff.o : $(srcdir)/config/obj-ecoff.c $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c +obj-coff.o : $(srcdir)/config/obj-coff.c + $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-coff.c + e-mipself.o : $(srcdir)/config/e-mipself.c $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c +e-i386coff.o : $(srcdir)/config/e-i386coff.c + $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-i386coff.c +e-i386elf.o : $(srcdir)/config/e-i386elf.c + $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-i386elf.c # The m68k operand parser. --- gas/as.c_ Mon Aug 19 12:28:38 1996 +++ gas/as.c Wed Jan 8 00:01:12 1997 @@ -146,6 +146,7 @@ extern struct emulation mipsbelf, mipslelf, mipself; extern struct emulation mipsbecoff, mipslecoff, mipsecoff; +extern struct emulation i386coff, i386elf; static struct emulation *const emulations[] = { EMULATIONS }; static const int n_emulations = sizeof (emulations) / sizeof (emulations[0]); --- gas/configure_ Wed Sep 11 19:20:03 1996 +++ gas/configure Wed Jan 8 10:02:57 1997 @@ -1029,6 +1029,7 @@ big) emulation="mipsbelf mipslelf mipself" ;; *) emulation="mipslelf mipsbelf mipself" ;; esac ;; + i386-*-*-elf) emulation="i386coff i386elf" ;; esac emulations="$emulations $emulation" @@ -1140,6 +1141,10 @@ fmt=elf file=mipself ;; mipsbecoff | mipslecoff) fmt=ecoff file=mipsecoff ;; + i386coff) + fmt=coff file=i386coff ;; + i386elf) + fmt=elf file=i386elf ;; esac formats="$formats $fmt" emfiles="$emfiles e-$file.o" --- gas/obj.h_ Tue Jan 7 23:41:06 1997 +++ gas/obj.h Tue Jan 7 23:44:09 1997 @@ -68,6 +68,7 @@ extern const struct format_ops elf_format_ops; extern const struct format_ops ecoff_format_ops; +extern const struct format_ops coff_format_ops; #ifndef this_format COMMON const struct format_ops *this_format; --- /dev/null Wed Jan 8 10:35:01 1997 +++ gas/config/e-i386elf.c Wed Jan 8 10:19:46 1997 @@ -0,0 +1,18 @@ +#include "as.h" +#include "emul.h" + +static const char * +i386elf_bfd_name () +{ + abort (); + return NULL; +} + +#define emul_bfd_name i386elf_bfd_name +#define emul_format &elf_format_ops + +#define emul_name "i386elf" +#define emul_struct_name i386elf +#define emul_default_endian 0 +#include "emul-target.h" + --- /dev/null Wed Jan 8 10:35:01 1997 +++ gas/config/e-i386coff.c Wed Jan 8 10:19:31 1997 @@ -0,0 +1,18 @@ +#include "as.h" +#include "emul.h" + +static const char * +i386coff_bfd_name () +{ + abort (); + return NULL; +} + +#define emul_bfd_name i386coff_bfd_name +#define emul_format &coff_format_ops + +#define emul_name "i386coff" +#define emul_struct_name i386coff +#define emul_default_endian 0 +#include "emul-target.h" + --- gas/config/obj-coff.c_ Tue Jan 7 22:50:56 1997 +++ gas/config/obj-coff.c Wed Jan 8 02:37:26 1997 @@ -18,7 +18,7 @@ along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - +#define OBJ_HEADER "obj-coff.h" #include "as.h" #include "obstack.h" #include "subsegs.h" @@ -328,7 +328,7 @@ void -obj_symbol_new_hook (symbolP) +coff_obj_symbol_new_hook (symbolP) symbolS *symbolP; { char underscore = 0; /* Symbol has leading _ */ @@ -869,7 +869,7 @@ } void -obj_read_begin_hook () +coff_obj_read_begin_hook () { /* These had better be the same. Usually 18 bytes. */ #ifndef BFD_HEADERS @@ -4215,6 +4215,7 @@ #else {"optim", s_ignore, 0}, /* For sun386i cc (?) */ {"ident", s_ignore, 0}, /* we don't yet handle this. */ + {"version", s_ignore, 0}, /* we don't yet handle this. */ #endif {"ABORT", s_abort, 0}, #ifdef TC_M88K @@ -4223,3 +4224,51 @@ #endif {NULL} /* end sentinel */ }; /* obj_pseudo_table */ + +void coff_pop_insert(void) +{ + pop_insert(obj_pseudo_table) ; +} + +static int +coff_sec_sym_ok_for_reloc (sec) + asection *sec; +{ + return (0); +} + +void no_func(void) +{ + abort(); +} +static int +null_func(void) +{ + return(0); +} + +const struct format_ops coff_format_ops = +{ + bfd_target_coff_flavour, + 0, + 1, + coff_frob_symbol, + coff_frob_file, + no_func, + 0, 0, + 0, 0, + 0, +#if 0 + obj_generate_asm_lineno, +#else + no_func, +#endif +#if 0 + obj_stab, +#else + no_func, +#endif + coff_sec_sym_ok_for_reloc, + coff_pop_insert, +#if 0 + obj_set_ext, +#else + no_func, +#endif + coff_obj_read_begin_hook, + coff_obj_symbol_new_hook, +}; --- gas/config/tc-i386.c_ Wed Jan 8 00:57:03 1997 +++ gas/config/tc-i386.c Wed Jan 8 01:15:08 1997 @@ -3001,6 +3001,19 @@ return rel; } +const char * +i386_target_format() +{ + switch (OUTPUT_FLAVOR) { + case bfd_target_coff_flavour: + return "coff-i386" ; + case bfd_target_elf_flavour: + return "elf32-i386" ; + default: + abort() ; + } +} + #else /* ! BFD_ASSEMBLER */ #if (defined(OBJ_AOUT) | defined(OBJ_BOUT)) --- gas/config/tc-i386.h_ Wed Jan 8 01:05:12 1997 +++ gas/config/tc-i386.h Wed Jan 8 01:19:18 1997 @@ -82,6 +82,7 @@ #ifdef OBJ_ELF #define TARGET_FORMAT "elf32-i386" #endif +#define TARGET_FORMAT i386_target_format() #else /* ! BFD_ASSEMBLER */ From ian@cygnus.com Wed Jan 8 10:50:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Wed, 08 Jan 1997 10:50:00 -0000 Subject: emulation on i386-coff, i386-elf patches References: Message-ID: <9701081850.AA12331@tweedledumb.cygnus.com> Date: Wed, 8 Jan 1997 12:00:26 -0600 (CST) From: Robert Lipe However, the COFF version has a problem that isn't obvious to me. Here is a disassembly of the same .s file generated with the native COFF=20 assembler and with this assembler in COFF mode. It looks to me like you need to hack md_apply_fix3 in tc-i386.c. In general, anything that does an #ifdef OBJ_ELF or #ifdef OBJ_COFF will have to be hacked. In fact, I'm not certain that the BFD_ASSEMBLER version of the i386 COFF assembler works correctly. You need to make sure that if you configure with --target i386-coff --enable-bfd-assembler the resulting code works. By the way, for some reason your patch came in scrambled, with lots of =20 strings scattered around. I can never remember how to get rid of those. Ian From raeburn@cygnus.com Wed Jan 8 12:07:00 1997 From: raeburn@cygnus.com (Ken Raeburn) Date: Wed, 08 Jan 1997 12:07:00 -0000 Subject: emulation on i386-coff, i386-elf patches References: <9701081850.AA12331@tweedledumb.cygnus.com> Message-ID: Ian Lance Taylor writes: > It looks to me like you need to hack md_apply_fix3 in tc-i386.c. In > general, anything that does an #ifdef OBJ_ELF or #ifdef OBJ_COFF will > have to be hacked. You can check OUTPUT_FLAVOR at run time. Accesses to flavour-specific structure members and such can also be conditionalized at compile time on OBJ_MAYBE_* macros like in the MIPS code. > In fact, I'm not certain that the BFD_ASSEMBLER version of the i386 > COFF assembler works correctly. You need to make sure that if you > configure with --target i386-coff --enable-bfd-assembler the resulting > code works. That's the first thing to check.... > By the way, for some reason your patch came in scrambled, with lots of > =20 strings scattered around. I can never remember how to get rid of > those. In Gnus, turning on MIME processing gets rid of them for me. From robertl@dgii.com Wed Jan 8 20:20:00 1997 From: robertl@dgii.com (Robert Lipe) Date: Wed, 08 Jan 1997 20:20:00 -0000 Subject: emulation on i386-coff, i386-elf patches References: <9701081850.AA12331@tweedledumb.cygnus.com> Message-ID: > It looks to me like you need to hack md_apply_fix3 in tc-i386.c. In > general, anything that does an #ifdef OBJ_ELF or #ifdef OBJ_COFF will > have to be hacked. Excellent catch, Ian. Carving up tc-i386.c gave me exactly the results I needed. The ELF emulation mode of the assembler seems to be in excellent shape. I just watched the COFF side trip over itself, but the failure case needs trimmed up considerably: $ make CC='gcc ' CFLAGS=-g gcc -c -I. -I../../gas-961217/binutils -I../bfd -I../../gas-961217/binutils/../ bfd -I../../gas-961217/binutils/../include -g ../../gas-961217/binutils/prdbg.c gcc -g -o objdump objdump.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o - L../bfd -lbfd -L../opcodes -lopcodes bucomm.o version.o filemode.o -L../bfd -lbf d ../libiberty/libiberty.a ld: line nbr entry (1125 0) found for non-relocatable symbol: section .text, fil e prdbg.o Note: this isn't GNU ld. Rebuilding that specific file without -g makes it go away. I'll pursue. > In fact, I'm not certain that the BFD_ASSEMBLER version of the i386 > COFF assembler works correctly. You need to make sure that if you > configure with --target i386-coff --enable-bfd-assembler the resulting > code works. Building that stand-alone results in it being unable to resolve: obj_read_begin_hook read.o obj_symbol_new_hook symbols.o I didn't pursue that aspect further. Since you and Ken both sound doubtful of BFD_ASSEMBLER on i386 COFF, could you offer hints on suspected problem areas? Sounds like I should take the time to get a 'make check' working. Thanx, guys. RJL From robertl@dgii.com Wed Jan 8 22:03:00 1997 From: robertl@dgii.com (Robert Lipe) Date: Wed, 08 Jan 1997 22:03:00 -0000 Subject: Patch to improve consistency in GAS Message-ID: Please apply this patch to GAS. Since this is my code, I feel pretty good about the relative "safety" of this move. It allows the .note section to be generated for building under ELF while not bringing a bunch of ELF-isms into obj-coff. It should be considered independently from other work in the assembler emulation stuff. Thank you. RJL Wed Jan 8 23:24:05 CST 1997 Robert Lipe * config/tc-i386.c (sco_id): Moved from here config/obj-elf.c (sco_id): to here. Adding the identifier really is an SCO ELF specific thing, not just a SCO x86 specific thing. *** gas.orig/config/tc-i386.c Tue Dec 17 03:05:30 1996 --- gas/config/tc-i386.c Wed Jan 8 23:08:22 1997 *************** *** 3073,3171 **** #endif /* BFD_ASSEMBLER? */ - #ifdef SCO_ELF - - /* Heavily plagarized from obj_elf_version. The idea is to emit the - SCO specific identifier in the .notes section to satisfy the SCO - linker. - - This looks more complicated than it really is. As opposed to the - "obvious" solution, this should handle the cross dev cases - correctly. (i.e, hosting on a 64 bit big endian processor, but - generating SCO Elf code) Efficiency isn't a concern, as there - should be exactly one of these sections per object module. - - SCO OpenServer 5 identifies it's ELF modules with a standard ELF - .note section. - - int_32 namesz = 4 ; Name size - int_32 descsz = 12 ; Descriptive information - int_32 type = 1 ; - char name[4] = "SCO" ; Originator name ALWAYS SCO + NULL - int_32 version = (major ver # << 16) | version of tools ; - int_32 source = (tool_id << 16 ) | 1 ; - int_32 info = 0 ; These are set by the SCO tools, but we - don't know enough about the source - environment to set them. SCO ld currently - ignores them, and recommends we set them - to zero. */ - - #define SCO_MAJOR_VERSION 0x1 - #define SCO_MINOR_VERSION 0x1 - - void - sco_id () - { - char *name; - unsigned int c; - char ch; - char *p; - asection *seg = now_seg; - subsegT subseg = now_subseg; - Elf_Internal_Note i_note; - Elf_External_Note e_note; - asection *note_secp = (asection *) NULL; - int i, len; - - /* create the .note section */ - - note_secp = subseg_new (".note", 0); - bfd_set_section_flags (stdoutput, - note_secp, - SEC_HAS_CONTENTS | SEC_READONLY); - - /* process the version string */ - - i_note.namesz = 4; - i_note.descsz = 12; /* 12 descriptive bytes */ - i_note.type = NT_VERSION; /* Contains a version string */ - - p = frag_more (sizeof (i_note.namesz)); - md_number_to_chars (p, (valueT) i_note.namesz, 4); - - p = frag_more (sizeof (i_note.descsz)); - md_number_to_chars (p, (valueT) i_note.descsz, 4); - - p = frag_more (sizeof (i_note.type)); - md_number_to_chars (p, (valueT) i_note.type, 4); - - p = frag_more (4); - strcpy (p, "SCO"); - - /* Note: this is the version number of the ELF we're representing */ - p = frag_more (4); - md_number_to_chars (p, (SCO_MAJOR_VERSION << 16) | (SCO_MINOR_VERSION), 4); - - /* Here, we pick a magic number for ourselves (yes, I "registered" - it with SCO. The bottom bit shows that we are compat with the - SCO ABI. */ - p = frag_more (4); - md_number_to_chars (p, 0x4c520000 | 0x0001, 4); - - /* If we knew (or cared) what the source language options were, we'd - fill them in here. SCO has given us permission to ignore these - and just set them to zero. */ - p = frag_more (4); - md_number_to_chars (p, 0x0000, 4); - - frag_align (2, 0); - - /* We probably can't restore the current segment, for there likely - isn't one yet... */ - if (seg && subseg) - subseg_set (seg, subseg); - } - - #endif /* SCO_ELF */ - /* end of tc-i386.c */ --- 3096,3099 ---- *** gas.orig/config/obj-elf.c Tue Dec 17 03:05:25 1996 --- gas/config/obj-elf.c Wed Jan 8 23:08:47 1997 *************** *** 1284,1289 **** --- 1284,1386 ---- #endif /* NEED_ECOFF_DEBUG */ } + #ifdef SCO_ELF + + /* Heavily plagarized from obj_elf_version. The idea is to emit the + SCO specific identifier in the .notes section to satisfy the SCO + linker. + + This looks more complicated than it really is. As opposed to the + "obvious" solution, this should handle the cross dev cases + correctly. (i.e, hosting on a 64 bit big endian processor, but + generating SCO Elf code) Efficiency isn't a concern, as there + should be exactly one of these sections per object module. + + SCO OpenServer 5 identifies it's ELF modules with a standard ELF + .note section. + + int_32 namesz = 4 ; Name size + int_32 descsz = 12 ; Descriptive information + int_32 type = 1 ; + char name[4] = "SCO" ; Originator name ALWAYS SCO + NULL + int_32 version = (major ver # << 16) | version of tools ; + int_32 source = (tool_id << 16 ) | 1 ; + int_32 info = 0 ; These are set by the SCO tools, but we + don't know enough about the source + environment to set them. SCO ld currently + ignores them, and recommends we set them + to zero. */ + + #define SCO_MAJOR_VERSION 0x1 + #define SCO_MINOR_VERSION 0x1 + + void + sco_id () + { + + char *name; + unsigned int c; + char ch; + char *p; + asection *seg = now_seg; + subsegT subseg = now_subseg; + Elf_Internal_Note i_note; + Elf_External_Note e_note; + asection *note_secp = (asection *) NULL; + int i, len; + + /* create the .note section */ + + note_secp = subseg_new (".note", 0); + bfd_set_section_flags (stdoutput, + note_secp, + SEC_HAS_CONTENTS | SEC_READONLY); + + /* process the version string */ + + i_note.namesz = 4; + i_note.descsz = 12; /* 12 descriptive bytes */ + i_note.type = NT_VERSION; /* Contains a version string */ + + p = frag_more (sizeof (i_note.namesz)); + md_number_to_chars (p, (valueT) i_note.namesz, 4); + + p = frag_more (sizeof (i_note.descsz)); + md_number_to_chars (p, (valueT) i_note.descsz, 4); + + p = frag_more (sizeof (i_note.type)); + md_number_to_chars (p, (valueT) i_note.type, 4); + + p = frag_more (4); + strcpy (p, "SCO"); + + /* Note: this is the version number of the ELF we're representing */ + p = frag_more (4); + md_number_to_chars (p, (SCO_MAJOR_VERSION << 16) | (SCO_MINOR_VERSION), 4); + + /* Here, we pick a magic number for ourselves (yes, I "registered" + it with SCO. The bottom bit shows that we are compat with the + SCO ABI. */ + p = frag_more (4); + md_number_to_chars (p, 0x4c520000 | 0x0001, 4); + + /* If we knew (or cared) what the source language options were, we'd + fill them in here. SCO has given us permission to ignore these + and just set them to zero. */ + p = frag_more (4); + md_number_to_chars (p, 0x0000, 4); + + frag_align (2, 0); + + /* We probably can't restore the current segment, for there likely + isn't one yet... */ + if (seg && subseg) + subseg_set (seg, subseg); + + } + + #endif /* SCO_ELF */ + const struct format_ops elf_format_ops = { bfd_target_elf_flavour, From robertl@dgii.com Wed Jan 8 22:04:00 1997 From: robertl@dgii.com (Robert Lipe) Date: Wed, 08 Jan 1997 22:04:00 -0000 Subject: gas fixes for x86 elf/coff emulations Message-ID: As promised, here's the additional work in config/tc-i386.c. I have now built binutils with gcc and the assembler with yesterday's patches plus this work. Problems remain with debugging (-gstabs aborts in COFF, COFF debugging gets tripped up by certain files) but in loose generalities, things work. Things seem to work quite well in ELF. I don't know at this time how much of the problems I'm seeing are artifacts of of the questionable (?) --iwth-bfd-assembler version of the COFF stuff. Whitespace may need to be adjusted. RJL Wed Jan 8 23:28:34 CST 1997 Robert Lipe * config/tc-i386.c: Several changes to allow emulations to work for x86 ELF and COFF. *** gas.orig/config/tc-i386.c Tue Dec 17 03:05:30 1996 --- gas/config/tc-i386.c Wed Jan 8 23:08:22 1997 *************** *** 104,110 **** /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful */ ! #if defined (TE_I386AIX) || defined (OBJ_ELF) const char comment_chars[] = "#/"; #else const char comment_chars[] = "#"; --- 104,110 ---- /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful */ ! #if defined (TE_I386AIX) || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) const char comment_chars[] = "#/"; #else const char comment_chars[] = "#"; *************** *** 118,124 **** #NO_APP at the beginning of its output. */ /* Also note that comments started like this one will always work if '/' isn't otherwise defined. */ ! #if defined (TE_I386AIX) || defined (OBJ_ELF) const char line_comment_chars[] = ""; #else const char line_comment_chars[] = "/"; --- 118,124 ---- #NO_APP at the beginning of its output. */ /* Also note that comments started like this one will always work if '/' isn't otherwise defined. */ ! #if defined (TE_I386AIX) || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) const char line_comment_chars[] = ""; #else const char line_comment_chars[] = "/"; *************** *** 555,564 **** operand_chars[(unsigned char) *p] = *p; } ! #ifdef OBJ_ELF record_alignment (text_section, 2); record_alignment (data_section, 2); record_alignment (bss_section, 2); #endif } --- 555,566 ---- operand_chars[(unsigned char) *p] = *p; } ! #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) ! if (OUTPUT_FLAVOR == bfd_target_elf_flavour) { record_alignment (text_section, 2); record_alignment (data_section, 2); record_alignment (bss_section, 2); + } #endif } *************** *** 2631,2640 **** if (fixP->fx_r_type == BFD_RELOC_32_PCREL && fixP->fx_addsy) { #ifndef OBJ_AOUT value += fixP->fx_where + fixP->fx_frag->fr_address; #endif ! #ifdef OBJ_ELF ! if (S_GET_SEGMENT (fixP->fx_addsy) == seg || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0) { /* Yes, we add the values in twice. This is because --- 2633,2644 ---- if (fixP->fx_r_type == BFD_RELOC_32_PCREL && fixP->fx_addsy) { #ifndef OBJ_AOUT + if (OUTPUT_FLAVOR == bfd_target_elf_flavour) value += fixP->fx_where + fixP->fx_frag->fr_address; #endif ! #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) ! if (OUTPUT_FLAVOR == bfd_target_elf_flavour) ! if (S_GET_SEGMENT (fixP->fx_addsy) == seg || (fixP->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0) { /* Yes, we add the values in twice. This is because *************** *** 2648,2655 **** /* Fix a few things - the dynamic linker expects certain values here, and we must not dissappoint it. */ ! #ifdef OBJ_ELF ! if (fixP->fx_addsy) switch(fixP->fx_r_type) { case BFD_RELOC_386_PLT32: /* Make the jump instruction point to the address of the operand. At --- 2652,2660 ---- /* Fix a few things - the dynamic linker expects certain values here, and we must not dissappoint it. */ ! #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) ! if ( (OUTPUT_FLAVOR == bfd_target_elf_flavour) && ! fixP->fx_addsy) switch(fixP->fx_r_type) { case BFD_RELOC_386_PLT32: /* Make the jump instruction point to the address of the operand. At *************** *** 2838,2856 **** flag_do_long_jump = 1; break; ! #ifdef OBJ_ELF /* -k: Ignore for FreeBSD compatibility. */ case 'k': break; /* -V: SVR4 argument to print version ID. */ case 'V': ! print_version_id (); break; /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section should be emitted or not. FIXME: Not implemented. */ case 'Q': break; #endif --- 2843,2866 ---- flag_do_long_jump = 1; break; ! #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) /* -k: Ignore for FreeBSD compatibility. */ case 'k': + if (OUTPUT_FLAVOR == bfd_target_elf_flavour) return 1 ; break; /* -V: SVR4 argument to print version ID. */ case 'V': ! if (OUTPUT_FLAVOR == bfd_target_elf_flavour) ! print_version_id (); ! else ! return 0 ; break; /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section should be emitted or not. FIXME: Not implemented. */ case 'Q': + if (OUTPUT_FLAVOR == bfd_target_elf_flavour) return 1 ; break; #endif *************** *** 3003,3008 **** --- 3013,3031 ---- return rel; } + const char * + i386_target_format() + { + switch (OUTPUT_FLAVOR) { + case bfd_target_coff_flavour: + return "coff-i386" ; + case bfd_target_elf_flavour: + return "elf32-i386" ; + default: + abort() ; + } + } + #else /* ! BFD_ASSEMBLER */ #if (defined(OBJ_AOUT) | defined(OBJ_BOUT)) From ian@cygnus.com Thu Jan 9 09:06:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Thu, 09 Jan 1997 09:06:00 -0000 Subject: emulation on i386-coff, i386-elf patches References: Message-ID: <199701091706.JAA09307@rtl.cygnus.com> Date: Wed, 8 Jan 1997 22:19:36 -0600 (CST) From: Robert Lipe > In fact, I'm not certain that the BFD_ASSEMBLER version of the i386 > COFF assembler works correctly. You need to make sure that if you > configure with --target i386-coff --enable-bfd-assembler the resulting > code works. Building that stand-alone results in it being unable to resolve: obj_read_begin_hook read.o obj_symbol_new_hook symbols.o I didn't pursue that aspect further. You can probably define both to be empty macros in tc-i386.h. Since you and Ken both sound doubtful of BFD_ASSEMBLER on i386 COFF, could you offer hints on suspected problem areas? Sounds like I should take the time to get a 'make check' working. Since you have access to an i386 COFF native system, the best check is to run `make CC=gcc bootstrap' in the gas build directory. That will do a three stage of gas with itself. The problem areas will be md_apply_fix and tc_gen_reloc. You will need to tweak them in apparently senseless fashion until they do the right thing (you should be able to figure out what the right thing is by looking at the object code generated by the non-BFD version). Unfortunately, gas reloc handling is broken, and fixing it is hard. Ian From raeburn@cygnus.com Sat Jan 18 17:41:00 1997 From: raeburn@cygnus.com (Ken Raeburn) Date: Sat, 18 Jan 1997 17:41:00 -0000 Subject: binutils snapshots Message-ID: <9701190141.AA04169@cujo.cygnus.com> The automatic snapshot code is still not working (due to firewall lossage), but I forced through one run manually tonight. Some 130K (gzipped) of diffs have been made since the last snapshot in December. If we still can't get the automatic scripts working, I'll try to run this by hand more often. Ken From sean@mcneil.com Sun Jan 26 17:17:00 1997 From: sean@mcneil.com (Sean McNeil) Date: Sun, 26 Jan 1997 17:17:00 -0000 Subject: subscribe Message-ID: <01BC0BAC.C8B50C00@mcneil.mcneil.com> subscribe sean@mcneil.com From sean@mcneil.com Sun Jan 26 17:22:00 1997 From: sean@mcneil.com (Sean McNeil) Date: Sun, 26 Jan 1997 17:22:00 -0000 Subject: subscribe Message-ID: <01BC0BAD.725C2360@mcneil.mcneil.com> I apologize for this. I mis-typed and forgot the -request. Sorry for the clutter. From joel@merlin.gcs.redstone.army.mil Tue Jan 28 12:30:00 1997 From: joel@merlin.gcs.redstone.army.mil (Joel Sherrill ) Date: Tue, 28 Jan 1997 12:30:00 -0000 Subject: config/mh-linux missing in gas-970127.tar.gz Message-ID: I am doing a one tree build of ppc-rtems on an i486-linux host and switched from binutils 2.7 to gas-970127 and while configuring it complained about config/mh-linux which was present in 2.7 but is not in the latest snapshots. I copied the one from 2.7 into the snapshot and it appears to be building fine now. --joel Joel Sherrill Sr. Computer Scientist joel@OARcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (205) 722-9985 From ian@cygnus.com Tue Jan 28 12:40:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Tue, 28 Jan 1997 12:40:00 -0000 Subject: config/mh-linux missing in gas-970127.tar.gz References: Message-ID: <199701282039.PAA22944@sanguine.cygnus.com> Date: Tue, 28 Jan 1997 14:26:20 -0600 (CST) From: "Joel Sherrill " I am doing a one tree build of ppc-rtems on an i486-linux host and switched from binutils 2.7 to gas-970127 and while configuring it complained about config/mh-linux which was present in 2.7 but is not in the latest snapshots. I copied the one from 2.7 into the snapshot and it appears to be building fine now. I don't think there is a bug here. The file mh-linux was intentionally removed, since it was useless. I am guessing that you are using the same object directory, and updated the sources, and didn't rerun configure, and got an error from Makefile telling you that mh-linux could not be found. The fix is to run ./config.status by hand. This will generate the correct Makefile with the correct dependencies. Although updating the sources with the same object directory will normally work, you can't assume that it will always work. Sometimes you must explicitly reconfigure. Ian From joel@OARcorp.com Mon Sep 15 12:05:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Mon, 15 Sep 1997 12:05:00 -0000 Subject: binutils 2.8.1 cpu32 bug Message-ID: Here is a fix I received from an RTEMS user. This was in binutils 2.8.1 and I am not sure whether or not it has been fixed since. --joel ===================================================================== *** binutils-2.8.1/opcodes/m68k-opc.c Wed Aug 6 09:47:31 1997 --- /usr/src/local/gnu/src/binutils-2.8.1.0.1/opcodes/m68k-opc.c Wed Jul 23 21:09:13 1997 *************** *** 1760,1766 **** #define TBL1(name,signed,round,size) \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ ! two(0177700,0107777), "`sD1", cpu32 }, \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ two(0177770,0107770), "DsD3D1", cpu32 } #define TBL(name1, name2, name3, s, r) \ --- 1760,1766 ---- #define TBL1(name,signed,round,size) \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ ! two(0177700,0107777), "@lD1", cpu32 }, \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ two(0177770,0107770), "DsD3D1", cpu32 } #define TBL(name1, name2, name3, s, r) \ *************** *** 1825,1837 **** {"trapv", one(0047166), one(0177777), "", m68000up }, ! {"tstb", one(0045000), one(0177700), ";b", m68020up | mcf5200 }, {"tstb", one(0045000), one(0177700), "@b", m68000up }, ! {"tstw", one(0045100), one(0177700), "*w", m68020up | mcf5200 }, ! {"tstw", one(0045110), one(0177700), "As", cpu32 }, {"tstw", one(0045100), one(0177700), "@w", m68000up }, ! {"tstl", one(0045200), one(0177700), "*l", m68020up | mcf5200 }, ! {"tstl", one(0045210), one(0177700), "As", cpu32 }, {"tstl", one(0045200), one(0177700), "@l", m68000up }, {"unlk", one(0047130), one(0177770), "As", m68000up | mcf5200 }, --- 1825,1835 ---- {"trapv", one(0047166), one(0177777), "", m68000up }, ! {"tstb", one(0045000), one(0177700), ";b", m68020up | mcf5200 | cpu32 }, {"tstb", one(0045000), one(0177700), "@b", m68000up }, ! {"tstw", one(0045100), one(0177700), "*w", m68020up | mcf5200 | cpu32 }, {"tstw", one(0045100), one(0177700), "@w", m68000up }, ! {"tstl", one(0045200), one(0177700), "*l", m68020up | mcf5200 | cpu32 }, {"tstl", one(0045200), one(0177700), "@l", m68000up }, {"unlk", one(0047130), one(0177770), "As", m68000up | mcf5200 }, From ian@cygnus.com Wed Sep 24 10:42:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Wed, 24 Sep 1997 10:42:00 -0000 Subject: binutils 2.8.1 cpu32 bug References: Message-ID: <199709241742.NAA05637@subrogation.cygnus.com> Date: Mon, 15 Sep 1997 14:05:26 -0500 (CDT) From: Joel Sherrill Here is a fix I received from an RTEMS user. This was in binutils 2.8.1 and I am not sure whether or not it has been fixed since. --joel ===================================================================== *** binutils-2.8.1/opcodes/m68k-opc.c Wed Aug 6 09:47:31 1997 --- /usr/src/local/gnu/src/binutils-2.8.1.0.1/opcodes/m68k-opc.c Wed Jul 23 21:09:13 1997 *************** *** 1760,1766 **** #define TBL1(name,signed,round,size) \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ ! two(0177700,0107777), "`sD1", cpu32 }, \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ two(0177770,0107770), "DsD3D1", cpu32 } #define TBL(name1, name2, name3, s, r) \ --- 1760,1766 ---- #define TBL1(name,signed,round,size) \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ ! two(0177700,0107777), "@lD1", cpu32 }, \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ two(0177770,0107770), "DsD3D1", cpu32 } #define TBL(name1, name2, name3, s, r) \ I don't understand this patch, and I would need more information. My m680x0 book indicates that the original value is correct, since the set of operands permitted for the tbl instructions are very limited. *************** *** 1825,1837 **** {"trapv", one(0047166), one(0177777), "", m68000up }, ! {"tstb", one(0045000), one(0177700), ";b", m68020up | mcf5200 }, {"tstb", one(0045000), one(0177700), "@b", m68000up }, ! {"tstw", one(0045100), one(0177700), "*w", m68020up | mcf5200 }, ! {"tstw", one(0045110), one(0177700), "As", cpu32 }, {"tstw", one(0045100), one(0177700), "@w", m68000up }, ! {"tstl", one(0045200), one(0177700), "*l", m68020up | mcf5200 }, ! {"tstl", one(0045210), one(0177700), "As", cpu32 }, {"tstl", one(0045200), one(0177700), "@l", m68000up }, {"unlk", one(0047130), one(0177770), "As", m68000up | mcf5200 }, --- 1825,1835 ---- {"trapv", one(0047166), one(0177777), "", m68000up }, ! {"tstb", one(0045000), one(0177700), ";b", m68020up | mcf5200 | cpu32 }, {"tstb", one(0045000), one(0177700), "@b", m68000up }, ! {"tstw", one(0045100), one(0177700), "*w", m68020up | mcf5200 | cpu32 }, {"tstw", one(0045100), one(0177700), "@w", m68000up }, ! {"tstl", one(0045200), one(0177700), "*l", m68020up | mcf5200 | cpu32 }, {"tstl", one(0045200), one(0177700), "@l", m68000up }, {"unlk", one(0047130), one(0177770), "As", m68000up | mcf5200 }, I checked in a version of this patch. Oddly, the original source does not appear in my sources. Thanks for sending it. Ian From joel@OARcorp.com Wed Sep 24 14:08:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Wed, 24 Sep 1997 14:08:00 -0000 Subject: binutils 2.8.1 cpu32 bug References: <199709241742.NAA05637@subrogation.cygnus.com> Message-ID: The user was on a 68360. I have a manual if you don't. Jus tlet me know what to look up. I do not know offhand what the actual bug being fixed was. Do you want me to ask them for a test case or example? --joel On Wed, 24 Sep 1997, Ian Lance Taylor wrote: > Date: Mon, 15 Sep 1997 14:05:26 -0500 (CDT) > From: Joel Sherrill > > Here is a fix I received from an RTEMS user. This was in binutils 2.8.1 > and I am not sure whether or not it has been fixed since. > > --joel > > ===================================================================== > *** binutils-2.8.1/opcodes/m68k-opc.c Wed Aug 6 09:47:31 1997 > --- /usr/src/local/gnu/src/binutils-2.8.1.0.1/opcodes/m68k-opc.c > Wed Jul 23 21:09:13 1997 > *************** > *** 1760,1766 **** > > #define TBL1(name,signed,round,size) \ > {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ > ! two(0177700,0107777), "`sD1", cpu32 }, \ > {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ > two(0177770,0107770), "DsD3D1", cpu32 } > #define TBL(name1, name2, name3, s, r) \ > --- 1760,1766 ---- > > #define TBL1(name,signed,round,size) \ > {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ > ! two(0177700,0107777), "@lD1", cpu32 }, \ > {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ > two(0177770,0107770), "DsD3D1", cpu32 } > #define TBL(name1, name2, name3, s, r) \ > > I don't understand this patch, and I would need more information. My > m680x0 book indicates that the original value is correct, since the > set of operands permitted for the tbl instructions are very limited. > > *************** > *** 1825,1837 **** > > {"trapv", one(0047166), one(0177777), "", m68000up }, > > ! {"tstb", one(0045000), one(0177700), ";b", m68020up | mcf5200 }, > {"tstb", one(0045000), one(0177700), "@b", m68000up }, > ! {"tstw", one(0045100), one(0177700), "*w", m68020up | mcf5200 }, > ! {"tstw", one(0045110), one(0177700), "As", cpu32 }, > {"tstw", one(0045100), one(0177700), "@w", m68000up }, > ! {"tstl", one(0045200), one(0177700), "*l", m68020up | mcf5200 }, > ! {"tstl", one(0045210), one(0177700), "As", cpu32 }, > {"tstl", one(0045200), one(0177700), "@l", m68000up }, > > {"unlk", one(0047130), one(0177770), "As", m68000up | mcf5200 }, > --- 1825,1835 ---- > > {"trapv", one(0047166), one(0177777), "", m68000up }, > > ! {"tstb", one(0045000), one(0177700), ";b", m68020up | > mcf5200 | cpu32 }, > {"tstb", one(0045000), one(0177700), "@b", m68000up }, > ! {"tstw", one(0045100), one(0177700), "*w", m68020up | > mcf5200 | cpu32 }, > {"tstw", one(0045100), one(0177700), "@w", m68000up }, > ! {"tstl", one(0045200), one(0177700), "*l", m68020up | > mcf5200 | cpu32 }, > {"tstl", one(0045200), one(0177700), "@l", m68000up }, > > {"unlk", one(0047130), one(0177770), "As", m68000up | mcf5200 }, > > I checked in a version of this patch. Oddly, the original source does > not appear in my sources. Thanks for sending it. > > Ian > From ian@cygnus.com Wed Sep 24 15:42:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Wed, 24 Sep 1997 15:42:00 -0000 Subject: binutils 2.8.1 cpu32 bug References: Message-ID: <199709242242.SAA12246@subrogation.cygnus.com> Date: Wed, 24 Sep 1997 16:08:10 -0500 (CDT) From: Joel Sherrill The user was on a 68360. I have a manual if you don't. Jus tlet me know what to look up. I do not know offhand what the actual bug being fixed was. Do you want me to ask them for a test case or example? I do have a manual. According to my reading of the manual, the existing code is correct. So I guess I want to know why this patch should be made, since the current code looks right to me. A test case would be a good start. Ian From joel@OARcorp.com Thu Sep 25 06:16:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Thu, 25 Sep 1997 06:16:00 -0000 Subject: binutils bug you reported (fwd) Message-ID: Here is a little more information on the binutils patch I got from a user. If it is not enough or you need me to send you a manual page or two, let me know. --joel ---------- Forwarded message ---------- Date: Wed, 24 Sep 97 16:09:00 -0600 From: Eric Norum To: Joel Sherrill Subject: Re: binutils bug you reported You wrote: > Do you have a test case or description? Ian was going to merge it > but did not understand why it was necessary. > > --joel > Here's the file I got from the Linux people: =================================================================== I guess, there are two small bug in gas (binutils 2.8.1), concerning cpu32 targets (68332). 1. 'tst.l a0' won't assemble any more (it worked fine in version 2.6). The reason is, that this addressing mode is allowed in 'binutils-2.8.1/opcodes/m68k-opc.c'only for targets 'm68020up'. My cpu32 reference manual (cpu32rm/ad rev 1) allows this addressing mode for word and long word operation I suggest one should change /binutils-2.8.1/opcodes/m68k-opc.c: original code: {"tstb", one(0045000), one(0177700), ";b", m68020up | mcf5200 }, {"tstb", one(0045000), one(0177700), "@b", m68000up }, {"tstw", one(0045100), one(0177700), "*w", m68020up | mcf5200 }, {"tstw", one(0045100), one(0177700), "@w", m68000up }, {"tstl", one(0045200), one(0177700), "*l", m68020up | mcf5200 }, {"tstl", one(0045200), one(0177700), "@l", m68000up }, new code: >>> {"tstb", one(0045000), one(0177700), ";b", m68020up | mcf5200 | cpu32 }, {"tstb", one(0045000), one(0177700), "@b", m68000up }, >>> {"tstw", one(0045100), one(0177700), "*w", m68020up | mcf5200 | cpu32 }, {"tstw", one(0045100), one(0177700), "@w", m68000up }, >>> {"tstl", one(0045200), one(0177700), "*l", m68020up | mcf5200 | cpu32 }, {"tstl", one(0045200), one(0177700), "@l", m68000up }, 2. 'tblu.w a0@,d0' won't assemble. The error message tells something about 'invalid operand'. The table lookup and interpolate opcode (tbls, tblsn, tblu, tblun) allows two types of operands: eg: tblu. ,Dx tblu. Dym:Dyn,Dx The first one (wich is not allowed by gas) is similar to the addressing mode of the 'mulu' opcode, except immediate data, so made the following change to /binutils-2.8.1/opcodes/m68k-opc.c: original code: #define TBL1(name,signed,round,size) \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ two(0177700,0107777), "`sD1", cpu32 }, \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ two(0177770,0107770), "DsD3D1", cpu32 } new code: #define TBL1(name,signed,round,size) \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \ >>> two(0177700,0107777), "@lD1", cpu32 }, \ {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \ two(0177770,0107770), "DsD3D1", cpu32 } --- Eric Norum eric@skatter.usask.ca Saskatchewan Accelerator Laboratory Phone: (306) 966-6308 University of Saskatchewan FAX: (306) 966-6058 Saskatoon, Canada. From ian@cygnus.com Thu Sep 25 10:00:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Thu, 25 Sep 1997 10:00:00 -0000 Subject: binutils bug you reported (fwd) References: Message-ID: <199709251700.NAA21402@subrogation.cygnus.com> Date: Thu, 25 Sep 1997 07:38:20 -0500 (CDT) From: Joel Sherrill 2. 'tblu.w a0@,d0' won't assemble. The error message tells something about 'invalid operand'. The table lookup and interpolate opcode (tbls, tblsn, tblu, tblun) allows two types of operands: eg: tblu. ,Dx tblu. Dym:Dyn,Dx Interesting. My basic Motorola manual says that tbls does not permits a0@, although it does permit a0@-, and that is what gas implements. However, the manual also says that tblu permits both a0@ and a0@-, and gas does not implement that. I checked a CPU32 specific manual, and it says that both instructions support a0@, and neither supports a0@-. I couldn't get any useful information from the Motorola web site. Since a0@- doesn't really make sense for these instructions, I'll change gas to not permit a0@-, but to permit a0@, for both. Either way, the submitted patch is wrong, since it permits operand types which are not actually permitted. Ian From joel@OARcorp.com Thu Sep 25 10:28:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Thu, 25 Sep 1997 10:28:00 -0000 Subject: binutils bug you reported (fwd) References: <199709251700.NAA21402@subrogation.cygnus.com> Message-ID: On Thu, 25 Sep 1997, Ian Lance Taylor wrote: > > 2. 'tblu.w a0@,d0' won't assemble. The error message tells something about > 'invalid operand'. The table lookup and interpolate opcode > (tbls, tblsn, > tblu, tblun) allows two types of operands: > > eg: > tblu. ,Dx > tblu. Dym:Dyn,Dx > > Interesting. My basic Motorola manual says that tbls does not permits > a0@, although it does permit a0@-, and that is what gas implements. > However, the manual also says that tblu permits both a0@ and a0@-, and > gas does not implement that. My reading of the 68000 Instruction Set Manual says that it is not permitted which is consistent with the implementation. But the CPU32 Reference Manual is pretty clear in that a0@ is permitted for both instructions but not a0@- or a0@+. Sounds like the manual set is very inconsistent. It would be interesting to listen to someone at Motorola squirm. :) > I checked a CPU32 specific manual, and it says that both instructions > support a0@, and neither supports a0@-. That's my interpretation as well. > I couldn't get any useful information from the Motorola web site. No Surprise here. They have a lot of stuff on their site but you can never find what you are looking for. > Since a0@- doesn't really make sense for these instructions, I'll > change gas to not permit a0@-, but to permit a0@, for both. > > Either way, the submitted patch is wrong, since it permits operand > types which are not actually permitted. Fine. It sounds like whoover wrote the patch was not that knowledgeable but knew there was a problem. Thanks. --joel From Ian.Dall@dsto.defence.gov.au Wed Oct 29 05:06:00 1997 From: Ian.Dall@dsto.defence.gov.au (Ian Dall) Date: Wed, 29 Oct 1997 05:06:00 -0000 Subject: ns32k support broken in gas 971029 snapshot (with fix) Message-ID: <199710291305.XAA08929@sibyl.chez-dall.org.au> Gas core dumps when trying to assemble instructions such as: movb _z(pc),_c(pc) The problem is in tc-ns32k.c (convert_iif). There is code which ends up calling frag_more with a negative argument, which causes an assertion to fail within frag_more(). When this code last worked, it did some fiddling of the obstack directly, which is admittedly evil. I have done some work to clean up this code and avoid the above problem. The patches are quite extensive, but that is mostly due to to a general tidy up reformatting to avoid excessive line lengths. The old code overloaded the opcode pointer under certain circumstances to point to data in the notes obstack. This was messy. The new code just adds those fields to the md part of the frag structure and the fix structure. This adds to the size of the frag structure for all targets and it may be time to make this conditional as per the comment in as.h (but I have not done so). Here is the proposed ChangeLog entry, diffs follow: Mon Oct 27 21:44:30 1997 Ian Dall * write.h (struct fix): comment fx_pcrel_adjust field. * write.c (print_fixup): Use TC_FIX_DATA_PRINT (if defined) to print out MD fields of fix. * frags.c (frag_var, frag_variant): Use TC_FRAG_INIT macro (if defined) to initialize MD fields in frag. * doc/internals.texi (Frags): document fr_opcode_frag and fr_opcode_offset fields. Documetn TC_PCREL_ADJUST macro. * config/tc-ns32k.h: Add comments. Remove obsolete BFD_FAST_SECTION_FILL definition, change prototypes for fix_new_ns32k and fix_new_ns32k_exp to add new arguments opcode_frag and opcode_offset and remove pcrel_adjust. (TC_FIX_TYPE): add opcode_fragP and opcode_offset fields. (TC_FIX_DATA_PRINT): new macro to print out TC_FIX_TYPE. (TC_FRAG_INIT): new macro to initialize machine dependent field in frags. (frag_opcode_frag, frag_opcode_offset, frag_bsr): macros to access MD fields in frag structure. (fix_im_disp, fix_bit_fixP, fix_opcode_frag, fix_opcode_offset, fix_bsr): macros to access MD fields in fix structure. * config/tc-ns32k.c: Avoid overlength lines. Align comments. Don't use struct opcode_location as these fields are now in the frag structure. (convert_iif): Call frag_more as it is needed instead of trying to allocate for the whole insn. Avoid call of frag_more with negative argument. (md_pcrel_adjust, md_fix_pcrel_adjust, md_apply_fix, md_estimate_size_before_relax, md_pcrel_from, tc_aout_fix_to_chars): use accessor macros to get md fields in fix and frag structures. (fix_new_ns32k, fix_new_ns32k_exp): add new arguments opcode_frag and opcode_offset and remove pcrel_adjust. (convert_iif, cons_fix_new_ns32k): call fix_new_ns32k, fix_new_ns32k_exp with changed arguments. * as.h: Move fragS typdef to before struct frag definition. Remove ns32k frag substructure and add fr_ns32k substructure. begin 644 gas-971029.diff.gz M'XL("&HS5S0``V=A-W(D7J\7R.1;-IM;G=Z6,>"6F\4?&L_H&9K1 MZPIZ@*3X04_`W_4G0E1"RQ.M1O.BW6@F'SU?NJ$,+F0@.@U=5,W&><-L4"O\ M7*-VO@ERAYYC!G;XY*E(?MRPU3P755=&XW"B"<>.9(@=X/=0C*5CRPLIHKD9 M"9!(X*^P`B\,ZV88RL78@3$MTQ56'`32C9PKZ",B,YC)*`*QIUX`A!9>&`EO M"F2D,,<>$)S#DU`3OA.'Y5H8#+2FWF$M"#&,?=\+(B0G]E\=B'#NQ!;#91QK4"9 M5*$!]W-/`HE^5X>^_?ZY6)@D5AA/IS*PW9F8!MY"C.TH\**&TM547'FQB((K MX<6L*\\%=2]85@'D62O`;P1:#E$[I`O4@C1#*1QX"N@K&Z"D*^CK%#^&8/!`3FHM=H/IK;)ZD!@AHVY M\E_\CO9>[K]1%$$3+SP4PG8M)Y[@V,!Q[#J@#Q&C#06V1M;.I?19O2'* M-_$NW5+>""WM'F@L#0;?D<8(&F)S&HP\'X<9X8.C[?1][(;VS(4!;`)AT@K@ M&\IHNZAX>%W0-GS^%@HOA6RWJ[5[K02R_P1>;%>*X>'_[;\]&`U/CD_W3D8' MQ[LOQ;_A=;5*\FS6_I*!-U+N0)II@$PX&P>F4T\:_72K%4[5(-AO4ER:+EDE MA+"0=7VGGW&\)!>K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>$UP%1WB>)'_0WJ8T9D:.H1T5C<[Q/` M9%>D;H1I[^*UTXM\VOGFZ,WC&"X)`+UP]+0-I]WI-!HC4.FFT7LQZ)X-1Y>! M\PT@H0?;P$UVME[^]\^'1Q_YAJ+*&.QY,G'J:LTF#]`R=C;%W/_=L>LIRJL^ M@XW1&.HZDM'JB!E&"UWH6.B^[AU8#!W!T6]O%Y;<.CAZ4N[)72"_+;A?Y&WV M4@FKZ4LEIZG<)&M+].4A.FDTK>6:.$)=@D/T")NR[1O9%B:?@'7N2[>8BHV7 M?V!?+N#57HHCSXSHFR2O*J//QH@+OSDY0[G-\5P2>O8H/?*QCMA&TM@R#([O735=E8VEHD45Y^-Q&7AL+W M7GLDI('RGV&:L*(+-8Q&.`,ADZS$QE9-#@@%^!=CGL5R2SOGI#*[CYT3T[`K MQ1%>'2RZ&K]4#H(9_8?BWA^%K-=BY\"\,=^"RY%K1=L6R M^]N":T7>YEPKC?2UDM-4KI7&DFNE55T+JBV=NXUV4Q[Y'J:*E%RRF1URZNR$ M6#L0.,_8<0%*YL?)I4G:891CMN6C9X^ZVSY M`Q`#AM&X=TEI=XC10Q:)W$O1I`M?IN9)V?IW$.F;]C*>F4)HA"B1)U`FXY8= MX*?).?!7XTL)D6?IX_UD]#[JFY@0HQ32@TF)$P`-K\]%M*]A?5SMVHAOQY>4 M,['L#WV+E2]`OM&,94-`&/UC#MKI5VF M#\=/DU,QXFB`>9]15(*9$:+8F1UWOX*Y MY4&Q'3:"=M7DK(EZIU*O&3_UOR9XS<#C^$R5!K']'<0W]<,/._NOU#/],'<7 M>!6PT(-X\GX(]R*E>.Z.`+?Z^#;NQI>EX_EPU'<3T291_'[8PRS:,`A!5,]2 46V+N8);>CMS%//\?@MW)(YHH`0#N ` end From Ian.Dall@dsto.defence.gov.au Tue Nov 4 05:56:00 1997 From: Ian.Dall@dsto.defence.gov.au (Ian Dall) Date: Tue, 04 Nov 1997 05:56:00 -0000 Subject: Target dependent frag fields (proposed change) Message-ID: <199711041355.AAA14448@sibyl.chez-dall.org.au> Following the comments in as.h, I decided to have a look at making the fields needed for the ns32k configurable. This turned out to not be very hard. Basically the problem is that you would want targ-*.h to define TC_FRAG_TYPE (like TC_FIX_TYPE for the fix structure), but the targ-*.h use the frag structure quite a bit so it has to be defined before the targ-*.h. The solution to to have an incomplete definition struct frag; before including the targ-*.h and defer a complete definition until afterwards. I don't have the resources to test this for all targets, but it works for the ns32k and looks safe for other targets. Ian ChangeLog Entry: Wed Nov 5 00:00:20 1997 Ian Dall * as.h: Move struct frag definition to after targ-*.h is included. Leave incomplete definition at old place. (struct frag): Add TC_FRAG_TYPE analagously to TC_FIX_TYPE. * config/tc-ns32k.h (TC_FRAG_TYPE): Define to contain ns32k target dependent frag fields. (frag_opcode_frag, frag_opcode_offset, frag_bsr): change to reflect TC_FRAG_TYPE definition. Patch: diff -rc ../gas-build/gas/as.h ./gas/as.h *** ../gas-build/gas/as.h Wed Oct 29 22:57:20 1997 --- ./gas/as.h Tue Nov 4 22:45:52 1997 *************** *** 395,472 **** typedef addressT relax_addressT; ! /* frags.c */ ! ! /* ! * A code fragment (frag) is some known number of chars, followed by some ! * unknown number of chars. Typically the unknown number of chars is an ! * instruction address whose size is yet unknown. We always know the greatest ! * possible size the unknown number of chars may become, and reserve that ! * much room at the end of the frag. ! * Once created, frags do not change address during assembly. ! * We chain the frags in (a) forward-linked list(s). The object-file address ! * of the 1st char of a frag is generally not known until after relax(). ! * Many things at assembly time describe an address by {object-file-address ! * of a particular frag}+offset. ! ! BUG: it may be smarter to have a single pointer off to various different ! notes for different frag kinds. See how code pans ! */ ! typedef struct frag fragS; - struct frag - { - /* Object file address. */ - addressT fr_address; - /* Chain forward; ascending address order. Rooted in frch_root. */ - struct frag *fr_next; - - /* (Fixed) number of chars we know we have. May be 0. */ - offsetT fr_fix; - /* (Variable) number of chars after above. May be 0. */ - offsetT fr_var; - /* For variable-length tail. */ - struct symbol *fr_symbol; - /* For variable-length tail. */ - offsetT fr_offset; - /* Points to opcode low addr byte, for relaxation. */ - char *fr_opcode; - - #ifndef NO_LISTING - struct list_info_struct *line; - #endif - - /* What state is my tail in? */ - relax_stateT fr_type; - relax_substateT fr_subtype; - - union { - /* These are needed only on the NS32K machines. But since we don't - include targ-cpu.h until after this structure has been defined, - we can't really conditionalize it. This code should be - rearranged a bit to make that possible. */ - struct { - fragS *fr_opcode_fragP; - unsigned int fr_opcode_offset; - char fr_bsr; - } fr_ns32k; - #ifdef USING_CGEN - /* Don't include this unless using CGEN to keep frag size down. */ - struct { - const struct cgen_insn *insn; - unsigned char opindex, opinfo; - } cgen; - #endif - } fr_targ; - - /* Where the frag was created, or where it became a variant frag. */ - char *fr_file; - unsigned int fr_line; - - /* Data begins here. */ - char fr_literal[1]; - }; #define SIZEOF_STRUCT_FRAG \ ((char *)zero_address_frag.fr_literal-(char *)&zero_address_frag) --- 395,404 ---- typedef addressT relax_addressT; ! struct frag; /* Complete definition after target ! dependent includes */ typedef struct frag fragS; #define SIZEOF_STRUCT_FRAG \ ((char *)zero_address_frag.fr_literal-(char *)&zero_address_frag) *************** *** 656,661 **** --- 588,660 ---- /* this one starts the chain of target dependant headers */ #include "targ-env.h" + + /* frags.c */ + + /* + * A code fragment (frag) is some known number of chars, followed by some + * unknown number of chars. Typically the unknown number of chars is an + * instruction address whose size is yet unknown. We always know the greatest + * possible size the unknown number of chars may become, and reserve that + * much room at the end of the frag. + * Once created, frags do not change address during assembly. + * We chain the frags in (a) forward-linked list(s). The object-file address + * of the 1st char of a frag is generally not known until after relax(). + * Many things at assembly time describe an address by {object-file-address + * of a particular frag}+offset. + + BUG: it may be smarter to have a single pointer off to various different + notes for different frag kinds. See how code pans + */ + + struct frag + { + /* Object file address. */ + addressT fr_address; + /* Chain forward; ascending address order. Rooted in frch_root. */ + struct frag *fr_next; + + /* (Fixed) number of chars we know we have. May be 0. */ + offsetT fr_fix; + /* (Variable) number of chars after above. May be 0. */ + offsetT fr_var; + /* For variable-length tail. */ + struct symbol *fr_symbol; + /* For variable-length tail. */ + offsetT fr_offset; + /* Points to opcode low addr byte, for relaxation. */ + char *fr_opcode; + + #ifndef NO_LISTING + struct list_info_struct *line; + #endif + + /* What state is my tail in? */ + relax_stateT fr_type; + relax_substateT fr_subtype; + + #ifdef TC_FRAG_TYPE + TC_FRAG_TYPE tc_frag_data; + #endif + + #ifdef USING_CGEN + /* Don't include this unless using CGEN to keep frag size down. + Change tc file to use TC_FRAG_TYPE */ + union { + struct { + const struct cgen_insn *insn; + unsigned char opindex, opinfo; + } cgen; + } fr_targ; + #endif + + /* Where the frag was created, or where it became a variant frag. */ + char *fr_file; + unsigned int fr_line; + + /* Data begins here. */ + char fr_literal[1]; + }; #include "struc-symbol.h" #include "write.h" diff -rc ../gas-build/gas/config/tc-ns32k.h ./gas/config/tc-ns32k.h *** ../gas-build/gas/config/tc-ns32k.h Wed Oct 29 22:57:23 1997 --- ./gas/config/tc-ns32k.h Mon Nov 3 23:30:53 1997 *************** *** 102,128 **** #define TC_FIX_DATA_PRINT(FILE, TC_FIX) \ ! do \ ! { \ ! fprintf((FILE), "\nopcode_frag=%p operand offset=%d, \ ! bsr=%d" , (TC_FIX).opcode_fragP, (TC_FIX).opcode_offset, \ ! (TC_FIX).bsr); \ ! } \ ! while(0) #define TC_FRAG_INIT(X) \ ! do \ ! { \ ! frag_opcode_frag(X) = NULL; \ ! frag_opcode_offset(X) = 0; \ ! frag_bsr(X) = 0; \ ! } \ ! while(0) /* Accessor macros for things which may move around */ ! #define frag_opcode_frag(X) (X)->fr_targ.fr_ns32k.fr_opcode_fragP ! #define frag_opcode_offset(X) (X)->fr_targ.fr_ns32k.fr_opcode_offset ! #define frag_bsr(X) (X)->fr_targ.fr_ns32k.fr_bsr #define TC_FIX_TYPE \ struct \ --- 102,135 ---- #define TC_FIX_DATA_PRINT(FILE, TC_FIX) \ ! do \ ! { \ ! fprintf((FILE), "\nopcode_frag=%p operand offset=%d, bsr=%d", \ ! (TC_FIX).opcode_fragP, (TC_FIX).opcode_offset, (TC_FIX).bsr); \ ! } \ ! while(0) #define TC_FRAG_INIT(X) \ ! do \ ! { \ ! frag_opcode_frag(X) = NULL; \ ! frag_opcode_offset(X) = 0; \ ! frag_bsr(X) = 0; \ ! } \ ! while(0) ! ! #define TC_FRAG_TYPE \ ! struct { \ ! fragS *fr_opcode_fragP; \ ! unsigned int fr_opcode_offset; \ ! char fr_bsr; \ ! } ! /* Accessor macros for things which may move around */ ! #define frag_opcode_frag(X) (X)->tc_frag_data.fr_opcode_fragP ! #define frag_opcode_offset(X) (X)->tc_frag_data.fr_opcode_offset ! #define frag_bsr(X) (X)->tc_frag_data.fr_bsr #define TC_FIX_TYPE \ struct \ From devans@cygnus.com Tue Nov 4 15:39:00 1997 From: devans@cygnus.com (Doug Evans) Date: Tue, 04 Nov 1997 15:39:00 -0000 Subject: ANSI strings, comment style, ... Message-ID: <199711042338.PAA03967@canuck.cygnus.com> I'm working on adding this patch, but a few comments. You're using ANSI C facilities to stop strings from running past 80 columns. Someone correct me if I'm wrong but I believe that's a no-no. [Is it written down somewhere what, if any, of ANSI C facilities one can use for GAS? Should we set a timeframe for when we'll start allowing such things?] Also, I couldn't find a passage in the GNU coding conventions that explicitly says so, but I think it's prefered that one write comments like this: void foo () { /* this is variable a, blah blah blah */ int a; /* this is variable b, blah blah blah */ int b; /* this is variable c, blah blah blah */ int c; ... } rather than this: void foo () { int a; /* this is variable a, blah blah blah */ int b; /* this is variable b, blah blah blah */ int c; /* this is variable c, blah blah blah */ ... } [i.e. write comments on a line by themselves, above what they refer to, rather than beside] I've applied your commenting changes as is [the ones that reduce the column width] but you may wish to switch over instead. Mon Oct 27 21:44:30 1997 Ian Dall * write.h (struct fix): comment fx_pcrel_adjust field. * write.c (print_fixup): Use TC_FIX_DATA_PRINT (if defined) to print out MD fields of fix. * frags.c (frag_var, frag_variant): Use TC_FRAG_INIT macro (if defined) to initialize MD fields in frag. * doc/internals.texi (Frags): document fr_opcode_frag and fr_opcode_offset fields. Documetn TC_PCREL_ADJUST macro. * config/tc-ns32k.h: Add comments. Remove obsolete BFD_FAST_SECTION_FILL definition, change prototypes for fix_new_ns32k and fix_new_ns32k_exp to add new arguments opcode_frag and opcode_offset and remove pcrel_adjust. (TC_FIX_TYPE): add opcode_fragP and opcode_offset fields. (TC_FIX_DATA_PRINT): new macro to print out TC_FIX_TYPE. (TC_FRAG_INIT): new macro to initialize machine dependent field in frags. (frag_opcode_frag, frag_opcode_offset, frag_bsr): macros to access MD fields in frag structure. (fix_im_disp, fix_bit_fixP, fix_opcode_frag, fix_opcode_offset, fix_bsr): macros to access MD fields in fix structure. * config/tc-ns32k.c: Avoid overlength lines. Align comments. Don't use struct opcode_location as these fields are now in the frag structure. (convert_iif): Call frag_more as it is needed instead of trying to allocate for the whole insn. Avoid call of frag_more with negative argument. (md_pcrel_adjust, md_fix_pcrel_adjust, md_apply_fix, md_estimate_size_before_relax, md_pcrel_from, tc_aout_fix_to_chars): use accessor macros to get md fields in fix and frag structures. (fix_new_ns32k, fix_new_ns32k_exp): add new arguments opcode_frag and opcode_offset and remove pcrel_adjust. (convert_iif, cons_fix_new_ns32k): call fix_new_ns32k, fix_new_ns32k_exp with changed arguments. * as.h: Move fragS typdef to before struct frag definition. Remove ns32k frag substructure and add fr_ns32k substructure. From ian@cygnus.com Tue Nov 4 15:46:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Tue, 04 Nov 1997 15:46:00 -0000 Subject: ANSI strings, comment style, ... References: <199711042338.PAA03967@canuck.cygnus.com> Message-ID: <199711042346.SAA24118@subrogation.cygnus.com> Date: Tue, 4 Nov 1997 15:38:12 -0800 From: Doug Evans You're using ANSI C facilities to stop strings from running past 80 columns. Someone correct me if I'm wrong but I believe that's a no-no. [Is it written down somewhere what, if any, of ANSI C facilities one can use for GAS? Should we set a timeframe for when we'll start allowing such things?] gas and the binutils are, of course, a special case, because they may be required to bootstrap the compiler. My inclination is to never permit ANSI C features. Or, to be slightly more reasonable, let's say not for the next five years. Ian From ian@cygnus.com Tue Nov 4 16:43:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Tue, 04 Nov 1997 16:43:00 -0000 Subject: ANSI strings, comment style, ... References: <199711050040.LAA07511@hfrd015.dsto.defence.gov.au> Message-ID: <199711050043.TAA27667@subrogation.cygnus.com> Date: Wed, 5 Nov 1997 11:10:31 +1030 From: Ian Dall To be honest I was not sure this was new in ANSI. We are not talking about cpp "#" and "##" operations. What I think we are talking about is writing: printf("A very long string. Warning: unacceptable argument to %s instruction", insn); as printf("A very long string." "Warning: unacceptable argument to %s instruction\n", insn); Yes, that sort of string concatenation is new in ANSI. If this is not acceptable, what is the preferred way to do this? I'd sooner not make it two printf's and I think printf("A very long string.\ Warning: unacceptable argument to %s instruction\n", insn); Is almost as ugly as just letting the line wrap. I say, let the line wrap. If it really bugs you, initialize a variable and print that. Note that you need a space between the `printf' and the open parenthesis in your example. In your first example, you can, and should, put ``insn'' on the next line. Ian From Ian.Dall@dsto.defence.gov.au Tue Nov 4 16:43:00 1997 From: Ian.Dall@dsto.defence.gov.au (Ian Dall) Date: Tue, 04 Nov 1997 16:43:00 -0000 Subject: ANSI strings, comment style, ... References: <199711042338.PAA03967@canuck.cygnus.com> <199711042346.SAA24118@subrogation.cygnus.com> <199711042346.SAA24118@subrogation.cygnus.com> Message-ID: <199711050040.LAA07511@hfrd015.dsto.defence.gov.au> Ian Lance Taylor writes: > Date: Tue, 4 Nov 1997 15:38:12 -0800 > From: Doug Evans > You're using ANSI C facilities to stop strings from running past > 80 columns. Someone correct me if I'm wrong but I believe > that's a no-no. [Is it written down somewhere what, if any, > of ANSI C facilities one can use for GAS? Should we set a timeframe for > when we'll start allowing such things?] > gas and the binutils are, of course, a special case, because they may > be required to bootstrap the compiler. My inclination is to never > permit ANSI C features. To be honest I was not sure this was new in ANSI. We are not talking about cpp "#" and "##" operations. What I think we are talking about is writing: printf("A very long string. Warning: unacceptable argument to %s instruction", insn); as printf("A very long string." "Warning: unacceptable argument to %s instruction\n", insn); If this is not acceptable, what is the preferred way to do this? I'd sooner not make it two printf's and I think printf("A very long string.\ Warning: unacceptable argument to %s instruction\n", insn); Is almost as ugly as just letting the line wrap. Ian From devans@cygnus.com Tue Nov 4 17:11:00 1997 From: devans@cygnus.com (Doug Evans) Date: Tue, 04 Nov 1997 17:11:00 -0000 Subject: Documenting new macros Message-ID: <199711050110.RAA07607@canuck.cygnus.com> I added docs for TC_FIX_DATA_PRINT (and TC_INIT_FIX_DATA while I was at it). Any time a new macro is created an accompanying .texi entry should be submitted (but there's no need to include a ChangeLog entry for it). From devans@cygnus.com Wed Nov 5 13:21:00 1997 From: devans@cygnus.com (Doug Evans) Date: Wed, 05 Nov 1997 13:21:00 -0000 Subject: Target dependent frag fields (proposed change) References: <199711041355.AAA14448.cygnus.gas2@sibyl.chez-dall.org.au> Message-ID: Ian.Dall@dsto.defence.gov.au (Ian Dall) writes: > Following the comments in as.h, I decided to have a look at making the > fields needed for the ns32k configurable. > > This turned out to not be very hard. Basically the problem is that you > would want targ-*.h to define TC_FRAG_TYPE (like TC_FIX_TYPE for the > fix structure), but the targ-*.h use the frag structure quite a bit so > it has to be defined before the targ-*.h. I checked in something along these lines and will be in the next snapshot. From hjl@lucon.org Thu Nov 6 11:54:00 1997 From: hjl@lucon.org (H.J. Lu) Date: Thu, 06 Nov 1997 11:54:00 -0000 Subject: An alpha/gas bug Message-ID: The recent gas has an alpha bug. I enclosed 4 files here: 1. foo.cc is the source code. 2. foo.s is compiled with -O -S on linux/alpha with egcs 971031. 3. good.o is assembled with gas in binutils 2.8.1. 4. bad.o is assembled with gas in binutils gas-971031. I can use good.o with both libstdc++.so and libstdc++.a to generate a working binary. But I can use bad.o only with libstdc++.a to generate a working binary. When I link bad.o with libstdc++.so, I get junk output after 2 empty strings: It seems that the return value from cout << is messed up when libstdc++.so is used. BTW, the asm output from -O2 works fine with gas-971031. From what I see, binutils 2.8.1 and binutils gas-971031 treat lda $0,_t12basic_string2ZcZt18string_char_traits1Zc$nilRep+32 differently. binutils 2.8.1 generates ldq v0,0(gp) lda v0,32(v0) and gas-971031 generates ldq v0,0(gp) I think that is a bug in gas. -- H.J. Lu (hjl@gnu.ai.mit.edu) --- begin 644 alpha.tar.gz M'XL(`!L<8C0``^U:2VP;11@>D]#&6QXI%*F\!]>"!-QE=OW*HY1`^HC$0U`> MBDJ%6:\W]E*_\*[!%2#*C0.'"G'@V$,H'#@4B8<$0JH`"0X<4K#)FR?&-5;C9+E6_BZ M577+=9C6DO/I')&W/-MU8<*$3JWIGX*>WW+K96_F!$KT"^_`H-3*A3TIU-33*=F>2FPD[!KEBM@M^R M7-\SCMO)NEL]YC2),K9EI,S,!#:!W1>=H)_,IG&H+WNM(%2[VJ@[A<+3YC_P MD*;FN>D*[&.+:6+?G.Y.>D8C[F:ZP1@Y&DPX4DRDD@:=*.YJ,&XTS+`?P'-* M(IBA1A$);WJR-Y5VH^VS7CY%LJPW&85"U2L4\@WLP+%J3\W;4:-T/6*5_!DY MX8X9>='6PEHA%XXQ5\?F!T:ZB(SCBX;1D_EOQ<)-\$`@:T\PERGA0]0N!@1Y MS$++_;G"KD=G4K'NT*3/\&$4VV[5=^N%DE-U?&`Q$J>LA9>(8EN8#1E!(M.B:T_;@FO0/'$T?GY&3AQ],GG)J%3MKW] MICZ-=",+I_,&2AMP@BRN^Z?S:`KA-;#3=%IN#>M9U_RBOWO_;@;<./W[DFEBLVX^!>\_$(N06=_3.Y^CO=2". MVZ_O`^";?1=7?]T'P(M?CH&#G\?W?#L/P)WG]@*TO!/`WP!X\R,P]\))`+X* M9'>`B]_=/;IZE!SC6":6@7.X_0SK+.,="6G/`?#0.5%O?!0]1`/\0Y0".#X_I(SRF#^_:\_U\[/2?)]^[===(;ZX`&*/G MH_A8P`>*A3S!=6O,^P4F=$T_?YKVS]#V%]J.C?;+580^'],J!K8[>I&T'""] MMDKYN\!M?7J/G>[)DG$=&0?@$M=?&.]=OQX?AR_U[-\A]+/X>/3RZBJ;GUGA M.O&W0,^[$TH0;D,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@H*"@K_#_P-HYH%U0!0```` ` end From rth@cygnus.com Mon Nov 10 13:25:00 1997 From: rth@cygnus.com (Richard Henderson) Date: Mon, 10 Nov 1997 13:25:00 -0000 Subject: An alpha/gas bug References: Message-ID: <19971110132616.52006@dot.cygnus.com> On Mon, Nov 10, 1997 at 04:20:06PM -0500, Ken Raeburn wrote: > > differently. binutils 2.8.1 generates > > > > ldq v0,0(gp) > > lda v0,32(v0) > > > > and gas-971031 generates > > > > ldq v0,0(gp) > > > > I'm in the middle of some gcc work right now, but I may look at this > tomorrow if Ian or Richard don't. The bug isn't in gas, since the relocation contains the proper offset. My guess is the bug is in ld.so, but I havn't had a chance to verify that; it could potentially be in ld. r~ From raeburn@cygnus.com Mon Nov 10 13:25:00 1997 From: raeburn@cygnus.com (Ken Raeburn) Date: Mon, 10 Nov 1997 13:25:00 -0000 Subject: An alpha/gas bug References: Message-ID: Just as an aside, it's helpful to include the relocs (objdump -dr) when including this sort of snippet in a bug report. The instructions alone aren't very informative without the relocs used, when they're GP-based. (Any interesting changes in the literal sections would be good to know too.) > differently. binutils 2.8.1 generates > > ldq v0,0(gp) > lda v0,32(v0) > > and gas-971031 generates > > ldq v0,0(gp) > I'm in the middle of some gcc work right now, but I may look at this tomorrow if Ian or Richard don't. Ken From hjl@lucon.org Mon Nov 10 13:31:00 1997 From: hjl@lucon.org (H.J. Lu) Date: Mon, 10 Nov 1997 13:31:00 -0000 Subject: An alpha/gas bug References: Message-ID: > > > Just as an aside, it's helpful to include the relocs (objdump -dr) > when including this sort of snippet in a bug report. The instructions > alone aren't very informative without the relocs used, when they're > GP-based. (Any interesting changes in the literal sections would be > good to know too.) > My bug report has the asm code and 2 .o files assembled by the working and non-working as. H.J. From kkaempf@progis.de Tue Nov 11 04:56:00 1997 From: kkaempf@progis.de (Klaus Kaempf) Date: Tue, 11 Nov 1997 04:56:00 -0000 Subject: binutils-971111, sparc-unknown-linux-gnulibc1, bootstrap failure Message-ID: <9711111254.AA29612@progis.de> This happens on a Sparc running redhat linux 4.2 (sparc-unknown-linux-gnulibc1) gcc -DHAVE_CONFIG_H -I. -I. -I. -D_GNU_SOURCE -DTRAD_CORE -I. -I. -I./../include -g -O2 -c trad-core.c trad-core.c: In function `trad_unix_core_file_p': trad-core.c:109: `PAGE_SIZE' undeclared (first use this function) trad-core.c:109: (Each undeclared identifier is reported only once trad-core.c:109: for each function it appears in.) trad-core.c:179: structure has no member named `start_data' trad-core.c:187: structure has no member named `start_stack' trad-core.c:204: structure has no member named `u_ar0' make[1]: *** [trad-core.lo] Error 1 make[1]: Leaving directory `/usr/local/src/gas-971111/bfd' make: *** [all-bfd] Error 2 -- proGIS Software E-Mail: kkaempf@progis.de Dipl.-Inform. Klaus K"ampf Fax: 0241-47067-29 Jakobstr. 117 Voice: 0241-47067-11 D-52064 Aachen WWW: http://www.progis.de From fila@ibi.com Tue Nov 25 01:40:00 1997 From: fila@ibi.com (Fila Kolodny) Date: Tue, 25 Nov 1997 01:40:00 -0000 Subject: Duplicate symbols in libbfd.so Message-ID: -----BEGIN PGP SIGNED MESSAGE----- In the 971124 snapshot of gas2 tekhex.lo is in both BFD_LIBS and BFD32_BACKENDS, thereby being multiply efined in libbfd.so when - --enable-targets=all is specified. I think that it should be removed from one or the other. -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia Charset: noconv iQB1AwUBNHqbfnXcXr6LKdS9AQF+TAL+I2wygay27gCqbnbbW/+6kDNeTGUC2gXs i61tH4oVoxKHuhBB4RCTSS2cfjEf6hSJjRJCuq1PIM4KDDsgzoKwv2FHmWe/NM9F yTs9lKoSegVOhcOZ5ggHTZm4mKvW6vLe =otOH -----END PGP SIGNATURE----- From fila@ibi.com Tue Nov 25 02:55:00 1997 From: fila@ibi.com (Fila Kolodny) Date: Tue, 25 Nov 1997 02:55:00 -0000 Subject: patches to coff-arm.c Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Could you please include this patch in the snapshots? Tue Nov 25 05:26:17 1997 Fila Kolodny * coff-arm.c: Make global items and routines static, with file scope to allow inclusion of coff-arm.o, pe-arm.o, and pei-arm.o in the same executable. diff -rup gas/bfd/coff-arm.c /home/fila/gas-971124/bfd/coff-arm.c - --- gas/bfd/coff-arm.c Mon Nov 24 10:31:15 1997 +++ /home/fila/gas-971124/bfd/coff-arm.c Tue Nov 25 05:15:28 1997 @@ -726,10 +726,10 @@ arm_reloc_type_lookup(abfd,code) /* The set of global variables that mark the total size of each kind of glue required. */ - -long int global_thumb_glue_size = 0; - -long int global_arm_glue_size = 0; +static long int global_thumb_glue_size = 0; +static long int global_arm_glue_size = 0; - -bfd* bfd_of_glue_owner = 0; +static bfd* bfd_of_glue_owner = 0; /* some typedefs for holding instructions */ typedef unsigned long int insn32; @@ -1459,7 +1459,7 @@ coff_arm_relocate_section (output_bfd, i return true; } - -boolean +static boolean arm_allocate_interworking_sections (info) struct bfd_link_info *info; { @@ -1620,7 +1620,7 @@ record_thumb_to_arm_glue (info, h) return; } - -boolean +static boolean arm_process_before_allocation (abfd, info) bfd * abfd; struct bfd_link_info * info; @@ -2050,7 +2050,7 @@ arm_get_last() /* Do the final link step. */ - -boolean +static boolean coff_arm_bfd_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia Charset: noconv iQB1AwUBNHqrx3XcXr6LKdS9AQGWnQL+M3baKj0IwRQBBUvgH4U94ed178kgNCeA 17+vylJBA4jCPQd+rvc0GnyUjOUJMfGpz+hsbQUVojPi20yLwEAJ/2XeFMoFqvaS JQE1TanIerVvp0ZQ26IVoaK0xryT+gEY =0hf5 -----END PGP SIGNATURE----- From fila@ibi.com Tue Nov 25 04:31:00 1997 From: fila@ibi.com (Fila Kolodny) Date: Tue, 25 Nov 1997 04:31:00 -0000 Subject: Error in 971125 snapshot Message-ID: It seems that there was a typo in yesterdays fix to coff-arm.c. Instead of COFF_WITH_PR it should be COFF_WITH_PE. From ian@cygnus.com Tue Nov 25 08:27:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Tue, 25 Nov 1997 08:27:00 -0000 Subject: Error in 971125 snapshot References: Message-ID: <199711251627.LAA05220@subrogation.cygnus.com> Date: Tue, 25 Nov 1997 07:16:30 -0500 (EST) From: Fila Kolodny It seems that there was a typo in yesterdays fix to coff-arm.c. Instead of COFF_WITH_PR it should be COFF_WITH_PE. Thanks. I fixed that. Ian From joel@OARcorp.com Mon Dec 8 06:09:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Mon, 08 Dec 1997 06:09:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 Message-ID: I ran into this error compiling gcc-2.8.0-971206 for powerpc-rtems using binutils 2.8.1: for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf _op_new _op_vnew _new_handler _op_delete _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh _pure; \ do \ echo ${name}; \ /usr1/rtems/work/tools_ada_311a/build-powerpc-tools/gcc/xgcc -B/usr1/rtems/work/tools_ada_311a/build-powerpc-tools/gcc/ -O2 -DCROSS_COMPILE -DIN_GCC -O2 -g -I./include -g1 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fexceptions -mrelocatable-lib -mno-eabi -mstrict-align -I. -I/usr1/rtems/work/tools_ada_311a/src/gcc -I/usr1/rtems/work/tools_ada_311a/src/gcc/config -c -DL${name} \ /usr1/rtems/work/tools_ada_311a/src/gcc/libgcc2.c -o ${name}.o; \ if [ $? -eq 0 ] ; then true; else exit 1; fi; \ /usr1/rtems/work/tools_ada_311a/build-powerpc-tools/binutils/ar rc tmplibgcc2.a ${name}.o; \ rm -f ${name}.o; \ ..... _eh /tmp/cca08918.s: Assembler messages: /tmp/cca08918.s:916: Internal error, aborting at /usr1/rtems/work/tools_ada_311a/src/gas/config/tc-ppc.c line 4759 in md_apply_fix3 I have cut off as much of the generated assembly as I could and still produce the error. The resulting .s file is below my signature. If there is a patch for this or if I should punt 2.8.1 and move to a snapshot, please let me know. Thanks. --joel Joel Sherrill Director of Research & Development joel@OARcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (205) 722-9985 .file "libgcc2.c" # rs6000/powerpc options: -msdata=data -G 8 # GNU C version 2.8.0 (powerpc-rtems) compiled by GNU C version 2.7.2. # options passed: -mrelocatable-lib -mno-eabi -mstrict-align -g -g1 -O2 # -O2 -fexceptions # options enabled: -fdefer-pop -fomit-frame-pointer -fcse-follow-jumps # -fcse-skip-blocks -fexpensive-optimizations -fthread-jumps # -fstrength-reduce -fpeephole -fforce-mem -ffunction-cse -finline # -fkeep-static-consts -fcaller-saves -fpcc-struct-return # -frerun-cse-after-loop -fschedule-insns -fschedule-insns2 -fPIC # -fexceptions -fsjlj-exceptions -fcommon -fverbose-asm -fgnu-linker # -mpowerpc -mnew-mnemonics -mno-fp-in-toc -mminimal-toc -mstrict-align # -mrelocatable -mrelocatable-lib -mtoc -mfull-toc -mcall-sysv # -msdata=data .section ".text" .Ltext0: .align 2 .globl __default_terminate .type __default_terminate,@function __default_terminate: stwu 1,-16(1) mflr 0 stw 0,20(1) bl abort@plt .Lfe1: .size __default_terminate,.Lfe1-__default_terminate .Lscope0: .globl __terminate_func .section ".sdata","aw" .align 2 .type __terminate_func,@object .size __terminate_func,4 __terminate_func: .LCP0: .long (__default_terminate)@fixup .section ".fixup","aw" .align 2 .long .LCP0 .previous .section ".got2","aw" .LCTOC1 = .+32768 .LC0 = .-.LCTOC1 .long __terminate_func .section ".text" .align 2 .globl __terminate .LCL0: .long .LCTOC1-.LCF0 .type __terminate,@function __terminate: stwu 1,-16(1) mflr 0 stw 30,8(1) stw 31,12(1) stw 0,20(1) bl .LCF0 .LCF0: mflr 30 lwz 0,(.LCL0-.LCF0)(30) add 30,0,30 lwz 9,.LC0(30) lwz 0,0(9) mtlr 0 blrl lwz 0,20(1) mtlr 0 lwz 30,8(1) lwz 31,12(1) addi 1,1,16 blr .Lfe2: .size __terminate,.Lfe2-__terminate .Lscope1: .align 2 .globl __throw_type_match .type __throw_type_match,@function __throw_type_match: stwu 1,-32(1) mflr 0 stw 29,20(1) stw 30,24(1) stw 31,28(1) stw 0,36(1) mr 29,5 bl strcmp@plt addic 3,3,-1 subfe 3,3,3 and 3,29,3 lwz 0,36(1) mtlr 0 lwz 29,20(1) lwz 30,24(1) lwz 31,28(1) addi 1,1,32 blr .Lfe3: .size __throw_type_match,.Lfe3-__throw_type_match .Lscope2: .align 2 .globl __empty .type __empty,@function __empty: blr .Lfe4: .size __empty,.Lfe4-__empty .Lscope3: .globl __dynamic_handler_chain .section ".sdata","aw" .align 2 .type __dynamic_handler_chain,@object .size __dynamic_handler_chain,4 __dynamic_handler_chain: .LCP1: .long (top_elt)@fixup .section ".fixup","aw" .align 2 .long .LCP1 .previous .section ".got2","aw" .LC1 = .-.LCTOC1 .long __dynamic_handler_chain .section ".text" .align 2 .globl __get_dynamic_handler_chain .LCL1: .long .LCTOC1-.LCF1 .type __get_dynamic_handler_chain,@function __get_dynamic_handler_chain: stwu 1,-16(1) mflr 0 stw 30,8(1) stw 31,12(1) stw 0,20(1) bl .LCF1 .LCF1: mflr 30 lwz 0,(.LCL1-.LCF1)(30) add 30,0,30 lwz 3,.LC1(30) lwz 0,20(1) mtlr 0 lwz 30,8(1) lwz 31,12(1) addi 1,1,16 blr .Lfe5: .size __get_dynamic_handler_chain,.Lfe5-__get_dynamic_handler_chain .Lscope4: .section ".got2","aw" .LC2 = .-.LCTOC1 .long .L11 .LC3 = .-.LCTOC1 .long __eh_info .LC4 = .-.LCTOC1 .long top_elt .LC5 = .-.LCTOC1 .long __dummy .section ".text" .align 2 .globl __sjthrow .LCL2: .long .LCTOC1-.LCF2 .type __sjthrow,@function __sjthrow: stwu 1,-1856(1) mflr 0 mfcr 12 stfd 14,1712(1) stfd 15,1720(1) stfd 16,1728(1) stfd 17,1736(1) stfd 18,1744(1) stfd 19,1752(1) stfd 20,1760(1) stfd 21,1768(1) stfd 22,1776(1) stfd 23,1784(1) stfd 24,1792(1) stfd 25,1800(1) stfd 26,1808(1) stfd 27,1816(1) stfd 28,1824(1) stfd 29,1832(1) stfd 30,1840(1) stfd 31,1848(1) stw 14,1640(1) stw 15,1644(1) stw 16,1648(1) stw 17,1652(1) stw 18,1656(1) stw 19,1660(1) stw 20,1664(1) stw 21,1668(1) stw 22,1672(1) stw 23,1676(1) stw 24,1680(1) stw 25,1684(1) stw 26,1688(1) stw 27,1692(1) stw 28,1696(1) stw 29,1700(1) stw 30,1704(1) stw 31,1708(1) stw 0,1860(1) stw 12,1636(1) mr 31,1 bl .LCF2 .LCF2: mflr 30 lwz 0,(.LCL2-.LCF2)(30) add 30,0,30 bl __get_dynamic_handler_chain@plt stw 3,1608(31) lwz 9,0(3) lwz 0,4(9) cmpwi 1,0,0 addi 9,9,4 stw 9,1612(31) bc 12,6,.L9 addi 8,31,8 stw 8,1616(31) li 0,0 stw 0,4(8) mr 10,3 lwz 0,0(10) stw 0,8(31) mr 0,8 lwz 9,.LC2(30) stwu 0,8(8) stw 8,1620(31) stw 9,4(8) lwz 0,0(1) li 9,0 stw 1,12(8) stw 0,8(8) b .L12 .L11: addi 31,31,-8 bl .LCF3 .LCL3: From ian@cygnus.com Mon Dec 8 09:26:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 08 Dec 1997 09:26:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: Message-ID: <199712081726.MAA01373@subrogation.cygnus.com> Date: Mon, 8 Dec 1997 08:09:24 -0600 (CST) From: Joel Sherrill If there is a patch for this or if I should punt 2.8.1 and move to a snapshot, please let me know. Thanks. Your test case appears to work with the powerpc-eabi target in the current sources. The problem may have something to do with the @plt. Ian From joel@OARcorp.com Mon Dec 8 11:20:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Mon, 08 Dec 1997 11:20:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: <199712081726.MAA01373@subrogation.cygnus.com> Message-ID: On Mon, 8 Dec 1997, Ian Lance Taylor wrote: > Date: Mon, 8 Dec 1997 08:09:24 -0600 (CST) > From: Joel Sherrill > > If there is a patch for this or if I should punt 2.8.1 and move to a > snapshot, please let me know. Thanks. > > Your test case appears to work with the powerpc-eabi target in the > current sources. The problem may have something to do with the @plt. I have downloaded gas-971208 and am retrying this. I have been wondering whether the egcs and gcc 2.8 releases imply binutils and newlib should have releases as well. I know the as.new -> as-new change is something which must be in sync for the one-tree build procedure to work. Thanks. --joel From ian@cygnus.com Mon Dec 8 11:20:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 08 Dec 1997 11:20:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: Message-ID: <199712081920.OAA04767@subrogation.cygnus.com> Date: Mon, 8 Dec 1997 13:08:19 -0600 (CST) From: Joel Sherrill I have been wondering whether the egcs and gcc 2.8 releases imply binutils and newlib should have releases as well. I know the as.new -> as-new change is something which must be in sync for the one-tree build procedure to work. Certainly there should be a binutils release. Unfortunately, it's a question of available time to produce one. I'll try to start the process soon. Ian From joel@OARcorp.com Mon Dec 8 11:32:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Mon, 08 Dec 1997 11:32:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: <199712081920.OAA04767@subrogation.cygnus.com> Message-ID: On Mon, 8 Dec 1997, Ian Lance Taylor wrote: > Date: Mon, 8 Dec 1997 13:08:19 -0600 (CST) > From: Joel Sherrill > > I have been wondering whether the egcs and gcc 2.8 releases imply binutils > and newlib should have releases as well. I know the as.new -> as-new > change is something which must be in sync for the one-tree build procedure > to work. > > Certainly there should be a binutils release. Unfortunately, it's a > question of available time to produce one. I'll try to start the > process soon. I understand completely. It is tough to get things to stabilize, find time to test, and hope that the releases of multiple interdependent packages happen close to one another. I am trying to get an RTEMS release out the door now. And gcc 2.8/egcs 1.0 are the first gcc releases with RTEMS support. --joel From ian@cygnus.com Mon Dec 8 14:14:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 08 Dec 1997 14:14:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: Message-ID: <199712082214.RAA12184@subrogation.cygnus.com> From: hjl@lucon.org (H.J. Lu) Date: Mon, 8 Dec 1997 14:08:14 -0800 (PST) Does soname work now? Thanks. In what way was it broken? As far as I know, it has worked for a couple of years now. Somebody did send a bug report to bug-gnu-utils about what they described as an soname bug in the GNU linker, but, as I indicated in my reply, the bug, if it was a bug, was actually in gcc, not in the linker. Ian From hjl@lucon.org Mon Dec 8 14:22:00 1997 From: hjl@lucon.org (H.J. Lu) Date: Mon, 08 Dec 1997 14:22:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: <199712082214.RAA12184@subrogation.cygnus.com> Message-ID: > > From: hjl@lucon.org (H.J. Lu) > Date: Mon, 8 Dec 1997 14:08:14 -0800 (PST) > > Does soname work now? Thanks. > > In what way was it broken? As far as I know, it has worked for a > couple of years now. > The new gas snapshot has libbfd.so.0.0.0. I'd like to see libbfd.so.2.8.1.0.18. Unfortunately there is no easy way to do it since I can only get libbfd.so.2.8.1 even if I want to make a binutils 2.8.1.0.18 for Linux. If I use libbfd.so.2.8.1, it will confuse people. H.J. From ian@cygnus.com Mon Dec 8 14:38:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 08 Dec 1997 14:38:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: Message-ID: <199712082229.RAA12229@subrogation.cygnus.com> From: hjl@lucon.org (H.J. Lu) Date: Mon, 8 Dec 1997 14:22:04 -0800 (PST) > Does soname work now? Thanks. > > In what way was it broken? As far as I know, it has worked for a > couple of years now. The new gas snapshot has libbfd.so.0.0.0. I'd like to see libbfd.so.2.8.1.0.18. Unfortunately there is no easy way to do it since I can only get libbfd.so.2.8.1 even if I want to make a binutils 2.8.1.0.18 for Linux. If I use libbfd.so.2.8.1, it will confuse people. Oh that. No, that hasn't been fixed yet. Getting the version number to match the release number is a libtool issue. If you figure out a clean patch, I'll be happy to use it. Ian From hjl@lucon.org Mon Dec 8 14:38:00 1997 From: hjl@lucon.org (H.J. Lu) Date: Mon, 08 Dec 1997 14:38:00 -0000 Subject: binutils 2.8.1 problem compiling gcc-2.8.0-971206 References: <199712081920.OAA04767@subrogation.cygnus.com> Message-ID: > > Date: Mon, 8 Dec 1997 13:08:19 -0600 (CST) > From: Joel Sherrill > > I have been wondering whether the egcs and gcc 2.8 releases imply binutils > and newlib should have releases as well. I know the as.new -> as-new > change is something which must be in sync for the one-tree build procedure > to work. > > Certainly there should be a binutils release. Unfortunately, it's a > question of available time to produce one. I'll try to start the > process soon. > Does soname work now? Thanks. -- H.J. Lu (hjl@gnu.org) From joel@OARcorp.com Thu Dec 11 07:01:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Thu, 11 Dec 1997 07:01:00 -0000 Subject: i386-go32 problem in gas-971208 Message-ID: I recently switched from binutils 2.8.1 to gas-971208 and ran into the following problem building for i386-go32-rtems: Testing libgcc1. Ignore linker warning messages. /usr1/rtems/work/tools/build-i386-go32-tools/gcc/xgcc -B/usr1/rtems/work/tools/build-i386-go32-tools/gcc/ -DCROSS_COMPILE -DIN_GCC -O2 -g -I./include libgcc1-test.o -o libgcc1-test \ -nostartfiles -nostdlib `/usr1/rtems/work/tools/build-i386-go32-tools/gcc/xgcc -B/usr1/rtems/work/tools/build-i386-go32-tools/gcc/ --print-libgcc-file-name` /usr1/rtems/work/tools/build-i386-go32-tools/gcc/collect-ld: target coff-go32-exe not found collect2: ld returned 1 exit status The same build procedure worked fine for 2.8.1. Any ideas what broke? Thanks. --joel From ian@cygnus.com Thu Dec 11 08:35:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Thu, 11 Dec 1997 08:35:00 -0000 Subject: i386-go32 problem in gas-971208 References: Message-ID: <199712111635.LAA27755@subrogation.cygnus.com> Date: Thu, 11 Dec 1997 09:01:48 -0600 (CST) From: Joel Sherrill I recently switched from binutils 2.8.1 to gas-971208 and ran into the following problem building for i386-go32-rtems: Testing libgcc1. Ignore linker warning messages. /usr1/rtems/work/tools/build-i386-go32-tools/gcc/xgcc -B/usr1/rtems/work/tools/build-i386-go32-tools/gcc/ -DCROSS_COMPILE -DIN_GCC -O2 -g -I./include libgcc1-test.o -o libgcc1-test \ -nostartfiles -nostdlib `/usr1/rtems/work/tools/build-i386-go32-tools/gcc/xgcc -B/usr1/rtems/work/tools/build-i386-go32-tools/gcc/ --print-libgcc-file-name` /usr1/rtems/work/tools/build-i386-go32-tools/gcc/collect-ld: target coff-go32-exe not found collect2: ld returned 1 exit status The same build procedure worked fine for 2.8.1. Any ideas what broke? It means that the linker tried to create a BFD of type coff-go32-exe, but that BFD type was not defined. The go32 code was changed around by Robert Hoehne . Part of that change was to change the target name used by go32 to i386-pc-msdosdjgpp. This doesn't work well with the RTEMS configuration triplet of i386-go32-rtems. Actually, a triplet of i386-go32-rtems doesn't make much sense to me, now that I think about it. I'm not sure what it is supposed to mean. i386-*-rtems should have a single object file format. If you want to support a different object file format, you should have a target like i386-*-rtemself or whatever. The snapshot isn't working because ld and bfd treat the i386-go32-rtems target differently. Ian From hjl@lucon.org Thu Dec 11 08:35:00 1997 From: hjl@lucon.org (H.J. Lu) Date: Thu, 11 Dec 1997 08:35:00 -0000 Subject: soname patch for gas2 References: <199712082229.RAA12229@subrogation.cygnus.com> Message-ID: > > From: hjl@lucon.org (H.J. Lu) > Date: Mon, 8 Dec 1997 14:22:04 -0800 (PST) > > > Does soname work now? Thanks. > > > > In what way was it broken? As far as I know, it has worked for a > > couple of years now. > > The new gas snapshot has libbfd.so.0.0.0. I'd like to see > libbfd.so.2.8.1.0.18. Unfortunately there is no easy way > to do it since I can only get libbfd.so.2.8.1 even if I > want to make a binutils 2.8.1.0.18 for Linux. If I use > libbfd.so.2.8.1, it will confuse people. > > Oh that. No, that hasn't been fixed yet. Getting the version number > to match the release number is a libtool issue. If you figure out a > clean patch, I'll be happy to use it. > > Ian > Here is the patch. I need extension for Linux since I have to make binutils 2.8.x.0.x for Linux. Otherwise, I have to use 2.8.x. It will be quite confusing. BTW, bfd/VERINFO doesn't have to be updated as often as VERSION. Thanks. -- H.J. Lu (hjl@gnu.org) -- Thu Dec 11 08:22:42 1997 H.J. Lu (hjl@gnu.org) * ltmain.sh (extension): New. Set from $vinfo. (versuffix): Add $extension for Linux. Thu Dec 11 08:22:42 1997 H.J. Lu (hjl@gnu.org) * bfd/Makefile.am (libbfd_la_LDFLAGS): New. (config.status): Depend on $(srcdir)/VERINFO. * bfd/configure.in (VERINFO): Substitute it. * bfd/VERINFO: New. Thu Dec 11 08:22:42 1997 H.J. Lu (hjl@gnu.org) * opcodes/Makefile.am (libopcodes_la_LDFLAGS): New. (config.status): Depend on $(srcdir)/../bfd/VERINFO. * opcodes/configure.in (VERINFO): Substitute it. Index: ltmain.sh =================================================================== RCS file: /home/work/cvs/gnu/binutils/ltmain.sh,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 ltmain.sh --- ltmain.sh 1997/11/18 17:24:56 1.1.1.2 +++ ltmain.sh 1997/12/11 09:06:52 @@ -609,6 +609,7 @@ current=0 revision=0 age=0 + extension= if test -n "$objs"; then echo "$progname: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 @@ -631,7 +632,7 @@ set dummy $vinfo IFS="$save_ifs" - if test -n "$5"; then + if test -n "$6"; then echo "$progname: too many parameters to \`-version-info'" 1>&2 echo "$help" 1>&2 exit 1 @@ -640,6 +641,7 @@ test -n "$2" && current="$2" test -n "$3" && revision="$3" test -n "$4" && age="$4" + test -n "$5" && extension="$5" # Check that each of the things are valid numbers. case "$current" in @@ -683,7 +685,11 @@ linux) version_vars="$version_vars major versuffix" major=`expr $current - $age` - versuffix="$major.$age.$revision" + if test -n "$extension"; then + versuffix="$major.$age.$revision.$extension" + else + versuffix="$major.$age.$revision" + fi ;; osf) Index: bfd/Makefile.am =================================================================== RCS file: /home/work/cvs/gnu/binutils/bfd/Makefile.am,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile.am --- bfd/Makefile.am 1997/10/25 21:56:17 1.1.1.1 +++ bfd/Makefile.am 1997/12/11 16:01:42 @@ -461,6 +463,9 @@ $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(includedir)/bfdlink.h +libbfd_la_LDFLAGS=-version-info @VERINFO@ +config.status: $(srcdir)/VERINFO + # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES). .dep: dep.sed $(CFILES) $(HFILES) bfd.h rm -f .dep1 Index: bfd/configure.in =================================================================== RCS file: /home/work/cvs/gnu/binutils/bfd/configure.in,v retrieving revision 1.1.1.34 diff -u -r1.1.1.34 configure.in --- bfd/configure.in 1997/11/18 17:27:05 1.1.1.34 +++ bfd/configure.in 1997/12/11 16:15:34 @@ -584,6 +585,22 @@ AC_SUBST(all_backends) AC_SUBST(bfd_backends) AC_SUBST(bfd_machines) + +verinfo=`cat ${srcdir}/VERINFO` +IFS="${IFS= }"; save_ifs="$IFS"; IFS='.' +set dummy $verinfo +IFS="$save_ifs" + +test -n "$2" && major=$2 +test -n "$3" && minor=$3 +test -n "$4" && patch=$4 +test -n "$5" && extension="$5" +test -n "$6" && extension="$extension.$6" +test -n "$7" && extension="$extension.$7" + +VERINFO=`expr $major + $minor`:$patch:$minor +test -n "$extension" && VERINFO=$VERINFO:$extension +AC_SUBST(VERINFO) tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" Index: opcodes/Makefile.am =================================================================== RCS file: /home/work/cvs/gnu/binutils/opcodes/Makefile.am,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Makefile.am --- opcodes/Makefile.am 1997/10/25 21:56:52 1.1.1.1 +++ opcodes/Makefile.am 1997/12/11 16:01:48 @@ -127,6 +127,8 @@ CLEANFILES = libopcodes.a stamp-lib dep.sed .dep .dep1 +libopcodes_la_LDFLAGS = -version-info @VERINFO@ +config.status: $(srcdir)/../bfd/VERINFO # This dependency stuff is copied from BFD. Index: opcodes/configure.in =================================================================== RCS file: /home/work/cvs/gnu/binutils/opcodes/configure.in,v retrieving revision 1.1.1.20 diff -u -r1.1.1.20 configure.in --- opcodes/configure.in 1997/11/18 17:28:46 1.1.1.20 +++ opcodes/configure.in 1997/12/11 16:15:14 @@ -172,4 +172,20 @@ AC_SUBST(archdefs) AC_SUBST(BFD_MACHINES) +verinfo=`cat ${srcdir}/../bfd/VERINFO` +IFS="${IFS= }"; save_ifs="$IFS"; IFS='.' +set dummy $verinfo +IFS="$save_ifs" + +test -n "$2" && major=$2 +test -n "$3" && minor=$3 +test -n "$4" && patch=$4 +test -n "$5" && extension="$5" +test -n "$6" && extension="$extension.$6" +test -n "$7" && extension="$extension.$7" + +VERINFO=`expr $major + $minor`:$patch:$minor +test -n "$extension" && VERINFO=$VERINFO:$extension +AC_SUBST(VERINFO) + AC_OUTPUT(Makefile) --- /dev/null Wed Dec 31 16:00:00 1969 +++ bfd/VERINFO Thu Dec 11 07:35:19 1997 @@ -0,0 +1 @@ +2.8.1.0.18 From joel@OARcorp.com Thu Dec 11 09:00:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Thu, 11 Dec 1997 09:00:00 -0000 Subject: i386-go32 problem in gas-971208 References: <199712111635.LAA27755@subrogation.cygnus.com> Message-ID: On Thu, 11 Dec 1997, Ian Lance Taylor wrote: > > The go32 code was changed around by Robert Hoehne > . Part of that change was to > change the target name used by go32 to i386-pc-msdosdjgpp. This > doesn't work well with the RTEMS configuration triplet of > i386-go32-rtems. Got it. It is compiling OK now. > Actually, a triplet of i386-go32-rtems doesn't make much sense to me, > now that I think about it. I'm not sure what it is supposed to mean. > i386-*-rtems should have a single object file format. If you want to > support a different object file format, you should have a target like > i386-*-rtemself or whatever. RTEMS has a bunch of what I call "normal" configurations and a handful of oddities. It is the oddities I have trouble naming. i386-go32-rtems is based on djgpp v1 (yes old) and uses the go32 dos extender to go into protected mode and kick off the rtems application. It requires slightly different newlib configuration and crt0.o as well as some support libraries from the djgpp distribution. This toolset configuration is subtly different from the vanilla embedded i386-rtems configuration. I really do not know what this one should be named. This ignores the harder rtems configurations like the ports to unix (solaris, linux, and hpux) where you can test rtems applications without a cpu simulator or real hw. :) --joel From joel@OARcorp.com Mon Dec 15 13:03:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Mon, 15 Dec 1997 13:03:00 -0000 Subject: i386-go32 Message-ID: Whether or not the name is right, it still does not work in gas-971208 but did in binutils 2.8.1. I checked the i386-go32 configuration against i386-go32-rtems and did not spot anything. I have tracked the problem down and it appears that the BFD vector is somehow misspecified. I have grep'ed all the configuration files but do not see the problem. gas prints a fatal error message because it can't find the target vector. I traced it with gdb and found: bfd_openw (filename=0x80793b5 "a.out", target=0x8082bc4 "coff-go32") at ../../src/bfd/opncls.c:348 348 bfd_set_error (bfd_error_system_call); (gdb) n 353 nbfd = _bfd_new_bfd (); (gdb) 354 if (nbfd == NULL) (gdb) 357 target_vec = bfd_find_target (target, nbfd); (gdb) s bfd_find_target (target_name=0x8082bc4 "coff-go32", abfd=0x80e9080) at ../../src/bfd/targets.c:958 958 if (target_name != NULL) (gdb) s 959 targname = target_name; (gdb) n 964 if (targname == NULL || strcmp (targname, "default") == 0) (gdb) 974 abfd->target_defaulted = false; (gdb) 976 target = find_target (targname); (gdb) 977 if (target == NULL) (gdb) 978 return NULL; (gdb) 982 } (gdb) bfd_openw (filename=0x80793b5 "a.out", target=0x8082bc4 "coff-go32") at ../../src/bfd/opncls.c:358 358 if (target_vec == NULL) (gdb) 371 objalloc_free ((struct objalloc *) nbfd->memory); (gdb) 372 free (nbfd); (gdb) 373 return NULL; (gdb) 377 } (gdb) write_object_file () at ../../src/gas/config/obj-coff.c:3128 3128 if (abfd == 0) (gdb) 3130 as_perror ("FATAL: Can't create %s", out_file_name); What do I have wrong in one of the configuration files? Thanks. --joel From ian@cygnus.com Mon Dec 15 13:08:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 15 Dec 1997 13:08:00 -0000 Subject: i386-go32 References: Message-ID: <199712152108.QAA23495@subrogation.cygnus.com> Date: Mon, 15 Dec 1997 15:03:43 -0600 (CST) From: Joel Sherrill Whether or not the name is right, it still does not work in gas-971208 but did in binutils 2.8.1. Sounds like you are hitting a bug, but I don't know what the problem is. The coff-go32 should be defined by compiling bfd/coff-go32.c. That should be included if go32coff_vec is in the list of supported targets. go32coff_vec is the default target for the i386-go32 configuration. Ian From joel@OARcorp.com Sat Dec 20 11:00:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Sat, 20 Dec 1997 11:00:00 -0000 Subject: gas-971208 mips64orion-rtems internal error Message-ID: The public domain floating point test paranoia when compiled by egcs 1.0 generates code which causes an internal error in gas. I have cut the code down to the following: .file 1 "p1.c" # -G value = 8, Cpu = 4650, ISA = 3 # GNU C version egcs-2.90.21 971202 (egcs-1.00 release) (mips64orion-rtems) compiled by GNU C version 2.7.2. # options passed: -mcpu=4650 # options enabled: -fpeephole -ffunction-cse -fkeep-static-consts # -fpcc-struct-return -fcommon -fverbose-asm -fgnu-linker -fargument-alias # -mgas -mfp64 -mgp64 -meb -mcpu=4650 gcc2_compiled.: __gnu_compiled_c: .globl One .align 3 One: .word 0x3ff00000 # 1 .word 0x00000000 .globl paranoia .ent paranoia paranoia: .frame $fp,72,$31 # vars= 8, regs= 3/1, args= 32, extra= 0 .mask 0xc0010000,-16 .fmask 0x00100000,-8 s.d $f0,One which when assembled as follows: mips64orion-rtems-as -mcpu=4650 -v p1.s generates this error message: p1.s: Assembler messages: p1.s:23: Internal error! Assertion failure in macro_build at ../../src/gas/config/tc-mips.c line 2365. Please report this bug. This file assembles with a warning about the missing ".end or .bend" with binutils 2.8.1. Thanks. --joel Joel Sherrill Director of Research & Development joel@OARcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (205) 722-9985 From joel@OARcorp.com Mon Dec 22 08:47:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Mon, 22 Dec 1997 08:47:00 -0000 Subject: patch for i386-go32-rtems in gas-971208 Message-ID: With the patch below my signature, i386-go32-rtems works again in gas-971208 just as in binutils 2.8.1. --joel Mon Mar 31 16:31:04 1997 Joel Sherrill * bfd/config.bfd (i[3456]86*-go32-rtems*): Fix to be the same as i[3456]86-go32. * gas/configure.in (i386*-go32-rtems*): Fix to be the same as i[3456]86-go32. diff -r -c gas-971208-orig/bfd/config.bfd gas-971208/bfd/config.bfd *** gas-971208-orig/bfd/config.bfd Mon Dec 8 03:18:59 1997 --- gas-971208/bfd/config.bfd Sat Dec 20 14:21:49 1997 *************** *** 152,158 **** targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; ! i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32*) targ_defvec=go32coff_vec targ_selvecs="go32stubbedcoff_vec i386aout_vec" ;; --- 152,158 ---- targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; ! i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* ) targ_defvec=go32coff_vec targ_selvecs="go32stubbedcoff_vec i386aout_vec" ;; diff -r -c gas-971208-orig/gas/configure.in gas-971208/gas/configure.in *** gas-971208-orig/gas/configure.in Mon Dec 8 03:30:17 1997 --- gas-971208/gas/configure.in Mon Dec 22 10:40:41 1997 *************** *** 167,173 **** i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*) fmt=coff ;; i386-*-vsta) fmt=aout ;; ! i386-*-msdosdjgpp* | i386-*-go32*) fmt=coff em=go32;; i386-*-rtems*) fmt=coff ;; i386-*-gnu*) fmt=elf ;; --- 167,173 ---- i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*) fmt=coff ;; i386-*-vsta) fmt=aout ;; ! i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*) fmt=coff em=go32;; i386-*-rtems*) fmt=coff ;; i386-*-gnu*) fmt=elf ;; From ian@cygnus.com Mon Dec 22 09:19:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 22 Dec 1997 09:19:00 -0000 Subject: gas-971208 mips64orion-rtems internal error References: Message-ID: <199712221719.MAA21659@subrogation.cygnus.com> Date: Sat, 20 Dec 1997 13:00:40 -0600 (CST) From: Joel Sherrill s.d $f0,One which when assembled as follows: mips64orion-rtems-as -mcpu=4650 -v p1.s generates this error message: p1.s: Assembler messages: p1.s:23: Internal error! Assertion failure in macro_build at ../../src/gas/config/tc-mips.c line 2365. Please report this bug. Interesting. Reporting the error in this manner is clearly a bug in gas. However, as far as I can tell, the input is not valid for the 4650. The 4650 has only single precision floating point, which means that it can not support the s.d instruction for a floating point register. It doesn't make any sense. So I think there must be a compiler bug here as well. I'll fix the bug in the assembler to report the error in a more coherent fashion. Ian From joel@OARcorp.com Mon Dec 22 09:27:00 1997 From: joel@OARcorp.com (Joel Sherrill) Date: Mon, 22 Dec 1997 09:27:00 -0000 Subject: gas-971208 mips64orion-rtems internal error References: <199712221719.MAA21659@subrogation.cygnus.com> Message-ID: On Mon, 22 Dec 1997, Ian Lance Taylor wrote: > generates this error message: > > p1.s: Assembler messages: > p1.s:23: Internal error! > Assertion failure in macro_build at ../../src/gas/config/tc-mips.c line > 2365. > Please report this bug. > > Interesting. Reporting the error in this manner is clearly a bug in > gas. > > However, as far as I can tell, the input is not valid for the 4650. > The 4650 has only single precision floating point, which means that it > can not support the s.d instruction for a floating point register. It > doesn't make any sense. > > So I think there must be a compiler bug here as well. > > I'll fix the bug in the assembler to report the error in a more > coherent fashion. Thanks. This certainly turned out to be more interesting than I expected. :) Should I just report this to the egcs list then along with the original offensive C program Is there something I can do to help make this one easier to find? It seems pretty weird. --joel From ian@cygnus.com Mon Dec 22 09:30:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 22 Dec 1997 09:30:00 -0000 Subject: gas-971208 mips64orion-rtems internal error References: Message-ID: <199712221730.MAA21675@subrogation.cygnus.com> Date: Mon, 22 Dec 1997 11:27:44 -0600 (CST) From: Joel Sherrill Should I just report this to the egcs list then along with the original offensive C program Yeah, I guess so. Is there something I can do to help make this one easier to find? It seems pretty weird. It's probably pretty easy to fix. There's probably just a missing TARGET_DOUBLE_FLOAT somewhere in mips.md or mips.c. The 4650 is not a particularly common chip, so it's quite plausible that changes to the MIPS code have introduced bugs in the 4650 support. It's also possible that my analysis is wrong, although it seems right to me. Ian From koop@koop.inka.de Mon Dec 29 10:17:00 1997 From: koop@koop.inka.de (Felix A. Koop) Date: Mon, 29 Dec 1997 10:17:00 -0000 Subject: no more snapshots? Message-ID: Hi, the latest snapshot on the ftp server is 971215. Did the location move or do you only have some problems with the SW? Greetings Felix A. Koop koop@koop.inka.de From ian@cygnus.com Mon Dec 29 10:27:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 29 Dec 1997 10:27:00 -0000 Subject: no more snapshots? References: Message-ID: <199712291827.NAA24678@subrogation.cygnus.com> Date: Mon, 29 Dec 1997 19:20:02 +0100 (MET) From: "Felix A. Koop" the latest snapshot on the ftp server is 971215. Did the location move or do you only have some problems with the SW? We've been having various problems, which we've been fixing one by one. All the known problems have been fixed, and perhaps tonight's snapshot will work. Ian From phdm@macqel.be Mon Dec 29 19:09:00 1997 From: phdm@macqel.be (Philippe De Muyter) Date: Mon, 29 Dec 1997 19:09:00 -0000 Subject: why is an archive member linked in ? Message-ID: <199712300309.EAA31445@mail.macqel.be> I need to answer the following ld-related question : why is some specific archive-member linked in ? Is there a gld option available or some other more intricated way to answer that question ? In the specific case I encountered, removing the module from the archive made my link command succeed, while with the module in the archive my link command failed because of some unresolved symbols in the module that got linked in. Thanks in advance Philippe De Muyter From dj@delorie.com Mon Dec 29 19:24:00 1997 From: dj@delorie.com (DJ Delorie) Date: Mon, 29 Dec 1997 19:24:00 -0000 Subject: why is an archive member linked in ? References: <199712300309.EAA31445@mail.macqel.be> Message-ID: <199712300324.WAA23012@delorie.com> > In the specific case I encountered, removing the module from the archive > made my link command succeed, while with the module in the archive my > link command failed because of some unresolved symbols in the module > that got linked in. Sometimes, there might be more than one object that resolves a specific symbol. If you take one out, the other gets used, and that changes everything. For example, DJGPP has two math libraries. One (libm.a) has a complete set of conforming (but slightly slower) functions, and the other (in libc.a) is smaller and faster, but less complete and less conforming. If you link in libm.a, you get that set, but if you leave it out, the ones in libc.a get used. From phdm@macqel.be Mon Dec 29 20:01:00 1997 From: phdm@macqel.be (Philippe De Muyter) Date: Mon, 29 Dec 1997 20:01:00 -0000 Subject: why is an archive member linked in ? References: <199712300324.WAA23012@delorie.com> Message-ID: <199712300401.FAA31778@mail.macqel.be> > > > > In the specific case I encountered, removing the module from the archive > > made my link command succeed, while with the module in the archive my > > link command failed because of some unresolved symbols in the module > > that got linked in. > > Sometimes, there might be more than one object that resolves a > specific symbol. If you take one out, the other gets used, and that > changes everything. > > For example, DJGPP has two math libraries. One (libm.a) has a > complete set of conforming (but slightly slower) functions, and the > other (in libc.a) is smaller and faster, but less complete and less > conforming. If you link in libm.a, you get that set, but if you leave > it out, the ones in libc.a get used. > Thanks. I already know that but that's the (slow and ugly) method I use to find why an archive member causing a link error is linked in. What I need is a clean and fast method, e.g. a gld option or, better, a direct information in the error message. Philippe From ian@cygnus.com Mon Dec 29 20:09:00 1997 From: ian@cygnus.com (Ian Lance Taylor) Date: Mon, 29 Dec 1997 20:09:00 -0000 Subject: why is an archive member linked in ? References: <199712300309.EAA31445@mail.macqel.be> Message-ID: <199712300409.XAA25552@subrogation.cygnus.com> Date: Tue, 30 Dec 1997 04:09:04 +0100 (MET) From: "Philippe De Muyter" I need to answer the following ld-related question : why is some specific archive-member linked in ? Is there a gld option available or some other more intricated way to answer that question ? Use the -M/-Map option, and look at the top of the mapfile. Ian