[PATCH 1/4] libibery/hashtab: add new functions

Alan Modra amodra@gmail.com
Mon Aug 17 14:19:59 GMT 2020


On Mon, Aug 17, 2020 at 04:01:44PM +0200, Martin Liška wrote:
> On 8/17/20 3:55 PM, Alan Modra wrote:
> > On Sat, Aug 15, 2020 at 07:46:33PM +0200, Martin Liska wrote:
> > > 
> > > include/ChangeLog:
> > > 
> > > 	* hashtab.h (htab_insert): New function.
> > > 	(htab_print_statistics): Likewise.
> > > 
> > > libiberty/ChangeLog:
> > > 
> > > 	* hashtab.c (htab_insert): New function.
> > > 	(htab_print_statistics): Likewise.
> > 
> > This one needs approval from the owning project, gcc.
> 
> I know, I'm going to send it to the owning project.
> 
> > The other
> > patches in the series looked reasonable enough to me, so I applied
> > them locally and ran a regression test.  First off, there's a compile
> > error:
> > gas/macro.c: In function ‘expand_irp’:
> > gas/macro.c:1402:10: error: ‘err’ may be used uninitialised in this function
> 
> Hmmm, I can't see it:
> 
> gcc -DHAVE_CONFIG_H -I. -I../../gas  -I. -I../../gas -I../bfd -I../../gas/config -I../../gas/../include -I../../gas/.. -I../../gas/../bfd -DLOCALEDIR="\"/home/marxin/bin/binutils/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -MT macro.o -MD -MP -MF $depbase.Tpo -c -o macro.o ../../gas/macro.c &&\
> mv -f $depbase.Tpo $depbase.Po
> /bin/sh ./libtool  --tag=CC   --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2   -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o  ../opcodes/libopcodes.la ../bfd/libbfd.la ../libiberty/libiberty.a   -ldl
> libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o  ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -L/home/marxin/Programming/binutils/objdir/zlib -lz ../libiberty/libiberty.a -ldl
> 
> > 
> > Fixing that then showed
> 
> Have you fixed it with setting err = NULL?

Yes.

diff --git a/gas/macro.c b/gas/macro.c
index 4a042d0fbe..817af11141 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -1358,6 +1358,7 @@ expand_irp (int irpc, size_t idx, sb *in, sb *out, size_t (*get_line) (sb *))
 	  ++idx;
 	}
 
+      err = NULL;
       while (idx < in->len)
 	{
 	  if (!irpc)

> 
> > m68hc11-elf  +FAIL: Motorola Assembly Language Input Standard
> > m68hc11-elf  +FAIL: 68HC12 specific addressing modes (opers12)
> > m68hc11-elf  +FAIL: Dwarf2 test on opers12.s
> > m68hc11-elf  +FAIL: 68HC12 branchs
> > m68hc11-elf  +FAIL: MRI label
> > m68hc11-elf  +FAIL: MRI EQU
> > m68hc11-elf  +FAIL: MRI floating point constants
> > m68hc11-elf  +FAIL: MRI character constants
> > m68hc11-elf  +FAIL: MRI expressions
> > m68hc11-elf  +FAIL: MRI common sections
> > m68hc11-elf  +FAIL: MRI comments
> > m68hc11-elf  +FAIL: MRI empty macro
> > m68hc11-elf  +FAIL: MRI semi
> > m68hc11-elf  +FAIL: ld-m68hc11/xgate1
> > m68hc12-elf  +FAIL: Motorola Assembly Language Input Standard
> > m68hc12-elf  +FAIL: 68HC12 specific addressing modes (opers12)
> > m68hc12-elf  +FAIL: Dwarf2 test on opers12.s
> > m68hc12-elf  +FAIL: 68HC12 branchs
> > m68hc12-elf  +FAIL: MRI label
> > m68hc12-elf  +FAIL: MRI EQU
> > m68hc12-elf  +FAIL: MRI floating point constants
> > m68hc12-elf  +FAIL: MRI character constants
> > m68hc12-elf  +FAIL: MRI expressions
> > m68hc12-elf  +FAIL: MRI common sections
> > m68hc12-elf  +FAIL: MRI comments
> > m68hc12-elf  +FAIL: MRI empty macro
> > m68hc12-elf  +FAIL: MRI semi
> > m68hc12-elf  +FAIL: ld-m68hc11/xgate1
> > m68k-elf  +FAIL: MRI floating point constants
> > m68k-elf  +FAIL: MRI character constants
> > m68k-elf  +FAIL: MRI common sections
> > m68k-elf  +FAIL: MRI comments
> > m68k-elf  +FAIL: MRI empty macro
> > m68k-elf  +FAIL: MRI semi
> > m68k-elf  +FAIL: MRI constants
> > m68k-elf  +FAIL: MRI immediate constants
> > m68k-elf  +FAIL: MRI structured for
> > m68k-elf  +FAIL: MRI structured if
> > m68k-elf  +FAIL: MRI structured repeat
> > m68k-elf  +FAIL: MRI structured while
> > m68k-elf  +FAIL: MRI moveml
> > m68k-linux  +FAIL: MRI floating point constants
> > m68k-linux  +FAIL: MRI character constants
> > m68k-linux  +FAIL: MRI common sections
> > m68k-linux  +FAIL: MRI comments
> > m68k-linux  +FAIL: MRI empty macro
> > m68k-linux  +FAIL: MRI semi
> > m68k-linux  +FAIL: MRI constants
> > m68k-linux  +FAIL: MRI immediate constants
> > m68k-linux  +FAIL: MRI structured for
> > m68k-linux  +FAIL: MRI structured if
> > m68k-linux  +FAIL: MRI structured repeat
> > m68k-linux  +FAIL: MRI structured while
> > m68k-linux  +FAIL: MRI moveml
> > s12z-elf  +FAIL: Test of disassembler behaviour with invalid bit manipulation instructions
> > s12z-elf  +FAIL: Handle truncated instruction gracefully.
> > s12z-elf  +FAIL: Expressions in OPR direct submode
> > spu-elf  +FAIL: .eqv support
> > spu-elf  +FAIL: forward references
> > spu-elf  +FAIL: .equ redefinitions
> > spu-elf  +FAIL: .equ redefinitions (2)
> > spu-elf  +FAIL: .equ redefinitions (3)
> > spu-elf  +FAIL: .equ redefinitions (ELF)
> > spu-elf  +FAIL: elf equate relocs
> > spu-elf  +FAIL: .set with expression
> > spu-elf  +FAIL: .set with IFUNC
> > spu-elf  +FAIL: Multibyte symbol names
> > spu-elf  +FAIL: gas/elf/common5a
> > spu-elf  +FAIL: gas/elf/common5b
> > spu-elf  +FAIL: gas/elf/common5c
> > spu-elf  +FAIL: gas/elf/common5d
> > spu-elf  +FAIL: ld-elf/pr17550a
> > spu-elf  +FAIL: ld-elf/pr17550b
> > spu-elf  +FAIL: ld-elf/pr17550c
> > spu-elf  +FAIL: ld-elf/pr17550d
> > z80-coff  +FAIL: index instructions with label as offset
> > z80-coff  +FAIL: data definition
> > z80-coff  +FAIL: eZ80 use unsupported registers as labels
> > z80-coff  +FAIL: quotes
> > z80-coff  +FAIL: SDCC compatibility mode
> > z80-coff  +FAIL: .set redefinitions
> > z80-coff  +FAIL: strings test
> > z80-elf  +FAIL: .equ redefinitions (ELF)
> > z80-elf  +FAIL: elf equate relocs
> > z80-elf  +FAIL: .set with expression
> > z80-elf  +FAIL: .set with IFUNC
> > z80-elf  +FAIL: Multibyte symbol names
> > z80-elf  +FAIL: gas/elf/common5a
> > z80-elf  +FAIL: gas/elf/common5b
> > z80-elf  +FAIL: gas/elf/common5c
> > z80-elf  +FAIL: gas/elf/common5d
> > z80-elf  +FAIL: index instructions with label as offset
> > z80-elf  +FAIL: data definition
> > z80-elf  +FAIL: eZ80 use unsupported registers as labels
> > z80-elf  +FAIL: quotes
> > z80-elf  +FAIL: SDCC compatibility mode
> > z80-elf  +FAIL: .set redefinitions
> > z80-elf  +FAIL: strings test
> > z80-elf  +FAIL: ld-elf/pr17550a
> > z80-elf  +FAIL: ld-elf/pr17550b
> > z80-elf  +FAIL: ld-elf/pr17550c
> > z80-elf  +FAIL: ld-elf/pr17550d
> > 
> 
> How do you run tests please? Do you build cross binutils?

Yes, I build whole lot of targets

~/src/binutils-gdb/configure --build=x86_64-linux \
--disable-nls \
--disable-gdb --disable-gdbserver --disable-sim --disable-readline \
--disable-libdecnumber --enable-obsolete --target=$target
make
make -k check


-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list