[PATCH 01/10] ld: Generate PDB string table
Alan Modra
amodra@gmail.com
Thu Dec 22 01:25:25 GMT 2022
More information about the Binutils mailing list
Thu Dec 22 01:25:25 GMT 2022
- Previous message (by thread): [PATCH 01/10] ld: Generate PDB string table
- Next message (by thread): [PATCH 01/10] ld: Generate PDB string table
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Dec 22, 2022 at 10:35:48AM +1030, Alan Modra wrote: > On Fri, Dec 09, 2022 at 01:52:31AM +0000, Mark Harmstone wrote: > > Resubmitted patch set as per Nick's request. > > The following is a show-stopper. Any target that doesn't have COFF > support enabled fails to build. This fixes the builds for me. However, it doesn't match the pdb support you have in bfd/config.bfd so I'm guessing you'll want to change it to only compile ld/pdb.c for x86 and make the calls in pe*.em to pdb functions conditional on x86. Or make bfd/pdb.c compile for all pe targets. diff --git a/ld/Makefile.am b/ld/Makefile.am index 65fef4e1690..005c38c9c16 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -466,6 +466,7 @@ ALL_64_EMULATIONS = $(ALL_64_EMULATION_SOURCES:.c=.@OBJEXT@) ALL_EMUL_EXTRA_OFILES = \ deffilep.@OBJEXT@ \ + pdb.@OBJEXT@ \ pe-dll.@OBJEXT@ \ ldelf.@OBJEXT@ \ ldelfgen.@OBJEXT@ @@ -496,7 +497,7 @@ OFILES = ldgram.@OBJEXT@ ldlex-wrapper.@OBJEXT@ lexsup.@OBJEXT@ ldlang.@OBJEXT@ mri.@OBJEXT@ ldctor.@OBJEXT@ ldmain.@OBJEXT@ plugin.@OBJEXT@ \ ldwrite.@OBJEXT@ ldexp.@OBJEXT@ ldemul.@OBJEXT@ ldver.@OBJEXT@ ldmisc.@OBJEXT@ \ ldfile.@OBJEXT@ ldcref.@OBJEXT@ ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES} \ - ldbuildid.@OBJEXT@ pdb.@OBJEXT@ + ldbuildid.@OBJEXT@ STAGESTUFF = *.@OBJEXT@ ldscripts/* e*.c @@ -960,7 +961,7 @@ EXTRA_ld_new_SOURCES += pep-dll.c pe-dll.c ldelf.c ldelfgen.c ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \ ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c plugin.c \ - ldbuildid.c pdb.c + ldbuildid.c ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \ $(BFDLIB) $(LIBCTF) $(LIBIBERTY) $(LIBINTL_DEP) $(JANSSON_LIBS) ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBCTF) \ diff --git a/ld/Makefile.in b/ld/Makefile.in index ff4c916c27b..f3d23c996d1 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -212,7 +212,7 @@ am_ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex-wrapper.$(OBJEXT) \ ldctor.$(OBJEXT) ldmain.$(OBJEXT) ldwrite.$(OBJEXT) \ ldexp.$(OBJEXT) ldemul.$(OBJEXT) ldver.$(OBJEXT) \ ldmisc.$(OBJEXT) ldfile.$(OBJEXT) ldcref.$(OBJEXT) \ - plugin.$(OBJEXT) ldbuildid.$(OBJEXT) pdb.$(OBJEXT) + plugin.$(OBJEXT) ldbuildid.$(OBJEXT) ld_new_OBJECTS = $(am_ld_new_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_LIBCTF_TRUE@am__DEPENDENCIES_2 = ../libctf/libctf.la @@ -965,6 +965,7 @@ ALL_64_EMULATION_SOURCES = \ ALL_64_EMULATIONS = $(ALL_64_EMULATION_SOURCES:.c=.@OBJEXT@) ALL_EMUL_EXTRA_OFILES = \ deffilep.@OBJEXT@ \ + pdb.@OBJEXT@ \ pe-dll.@OBJEXT@ \ ldelf.@OBJEXT@ \ ldelfgen.@OBJEXT@ @@ -994,7 +995,7 @@ OFILES = ldgram.@OBJEXT@ ldlex-wrapper.@OBJEXT@ lexsup.@OBJEXT@ ldlang.@OBJEXT@ mri.@OBJEXT@ ldctor.@OBJEXT@ ldmain.@OBJEXT@ plugin.@OBJEXT@ \ ldwrite.@OBJEXT@ ldexp.@OBJEXT@ ldemul.@OBJEXT@ ldver.@OBJEXT@ ldmisc.@OBJEXT@ \ ldfile.@OBJEXT@ ldcref.@OBJEXT@ ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES} \ - ldbuildid.@OBJEXT@ pdb.@OBJEXT@ + ldbuildid.@OBJEXT@ STAGESTUFF = *.@OBJEXT@ ldscripts/* e*.c SRC_POTFILES = $(CFILES) $(HFILES) @@ -1013,7 +1014,7 @@ EXTRA_ld_new_SOURCES = deffilep.y ldlex.l pep-dll.c pe-dll.c ldelf.c \ $(ALL_64_EMULATION_SOURCES) ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \ ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c plugin.c \ - ldbuildid.c pdb.c + ldbuildid.c ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \ $(BFDLIB) $(LIBCTF) $(LIBIBERTY) $(LIBINTL_DEP) $(JANSSON_LIBS) @@ -1579,7 +1580,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libldtestplug4_la-testplug4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libldtestplug_la-testplug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mri.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe-dll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pep-dll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin.Po@am__quote@ diff --git a/ld/configure.tgt b/ld/configure.tgt index 741b246f67e..2d7c14b6308 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -120,7 +120,7 @@ aarch64-*-haiku*) targ_emul=aarch64haiku ;; aarch64-*-pe*) targ_emul=aarch64pe - targ_extra_ofiles="deffilep.o pep-dll-aarch64.o" + targ_extra_ofiles="deffilep.o pdb.o pep-dll-aarch64.o" ;; alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) targ_emul=elf64alpha_fbsd @@ -163,15 +163,15 @@ arc*-*-linux*) case "${with_cpu}" in targ_extra_emuls="${targ_extra_emuls} arcelf arcv2elf arcv2elfx" ;; arm*-*-cegcc*) targ_emul=arm_wince_pe - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" LIB_PATH='${tooldir}/lib/w32api' ;; arm-wince-pe | arm-*-wince | arm*-*-mingw32ce*) targ_emul=arm_wince_pe - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; arm-*-pe) targ_emul=armpe - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; arm*b-*-freebsd*) targ_emul=armelfb_fbsd targ_extra_emuls="armelf_fbsd armelf" @@ -389,7 +389,7 @@ i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso targ_extra_libpath=$targ_extra_emuls ;; i[3-7]86-*-netbsdpe*) targ_emul=i386pe - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; i[3-7]86-*-netbsd* | \ i[3-7]86-*-netbsd*-gnu* | \ @@ -423,17 +423,17 @@ i[3-7]86-*-moss*) targ_emul=i386moss targ_extra_emuls=i386msdos ;; i[3-7]86-*-winnt*) targ_emul=i386pe ; - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; i[3-7]86-*-pe) targ_emul=i386pe ; - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; i[3-7]86-*-cygwin*) targ_emul=i386pe ; - targ_extra_ofiles="deffilep.o pe-dll.o" ; + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ; test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; i[3-7]86-*-mingw32*) targ_emul=i386pe ; - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; i[3-7]86-*-interix*) targ_emul=i386pe_posix; targ_extra_ofiles="deffilep.o pe-dll.o" @@ -503,7 +503,7 @@ m68*-*-haiku*) targ_emul=m68kelf m68*-*-*) targ_emul=m68kelf ;; mcore-*-pe) targ_emul=mcorepe ; - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; mcore-*-elf) targ_emul=elf32mcore ;; @@ -900,7 +900,7 @@ sh-*-nto*) targ_emul=shelf_nto targ_extra_emuls=shlelf_nto ;; sh-*-pe) targ_emul=shpe ; - targ_extra_ofiles="deffilep.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pe-dll.o" ;; sh-*-*) targ_emul=sh; targ_extra_emuls=shl @@ -1047,16 +1047,16 @@ x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) ;; x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ; targ_extra_emuls=i386pe ; - targ_extra_ofiles="deffilep.o pep-dll-x86_64.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pep-dll-x86_64.o pe-dll.o" ;; x86_64-*-cygwin) targ_emul=i386pep ; targ_extra_emuls=i386pe - targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o" test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; x86_64-*-mingw*) targ_emul=i386pep ; targ_extra_emuls=i386pe - targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" + targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o" ;; xgate-*-*) targ_emul=xgateelf targ_extra_ofiles=ldelfgen.o diff --git a/ld/pdb.c b/ld/pdb.c index 0346ccb388c..2df75e8f842 100644 --- a/ld/pdb.c +++ b/ld/pdb.c @@ -663,6 +663,7 @@ copy_filechksms (uint8_t *data, uint32_t size, char *string_table, /* Add the files to mod_source, so that they'll appear in the source info substream. */ + strptr = NULL; if (num_files > 0) { uint16_t new_count = num_files + mod_source->files_count; @@ -2004,25 +2005,15 @@ handle_debugs_section (asection *s, bfd *mod, struct string_table *strings, /* copy data */ + buf = NULL; if (c13_size != 0) - { - buf = xmalloc (c13_size); - bufptr = buf; - } - else - { - buf = NULL; - } + buf = xmalloc (c13_size); + bufptr = buf; + symbuf = NULL; if (sym_size != 0) - { - symbuf = xmalloc (sym_size); - symbufptr = symbuf; - } - else - { - symbuf = NULL; - } + symbuf = xmalloc (sym_size); + symbufptr = symbuf; off = sizeof (uint32_t); -- Alan Modra Australia Development Lab, IBM
- Previous message (by thread): [PATCH 01/10] ld: Generate PDB string table
- Next message (by thread): [PATCH 01/10] ld: Generate PDB string table
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list