• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂c4306ea069ec2207753c0413afee0f8551478f19 (tree)
時間2016-03-15 09:39:06
作者H.J. Lu <hjl.tools@gmai...>
CommiterH.J. Lu

Log Message

Set BFD_DECOMPRESS to decompress debug sections

We should set BFD_DECOMPRESS to decompress debug sections when reading in
DWARF debug sections.

Backport from master

bfd/

PR binutils/19523
* dwarf2.c (_bfd_dwarf2_slurp_debug_info): Set BFD_DECOMPRESS to
decompress debug sections.

binutils/

PR binutils/19523
* Makefile.am (check-DEJAGNU): Pass CC and CC_FOR_BUILD to
runtest.
* Makefile.in: Regenerated.
* testsuite/binutils-all/compress.exp (test_gnu_debuglink): New
proc.
Run test_gnu_debuglink for native ELF build.

Change Summary

差異

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
1+2016-03-14 H.J. Lu <hongjiu.lu@intel.com>
2+
3+ Backport from master
4+ 2016-01-28 H.J. Lu <hongjiu.lu@intel.com>
5+
6+ PR binutils/19523
7+ * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Set BFD_DECOMPRESS to
8+ decompress debug sections.
9+
110 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
211
312 PR ld/19579
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -3706,8 +3706,10 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd,
37063706 fail more quickly. */
37073707 return FALSE;
37083708
3709+ /* Set BFD_DECOMPRESS to decompress debug sections. */
37093710 if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL
3710- || ! bfd_check_format (debug_bfd, bfd_object)
3711+ || !(debug_bfd->flags |= BFD_DECOMPRESS,
3712+ bfd_check_format (debug_bfd, bfd_object))
37113713 || (msec = find_debug_info (debug_bfd,
37123714 debug_sections, NULL)) == NULL
37133715 || !bfd_generic_link_read_symbols (debug_bfd))
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,16 @@
1+2016-03-14 H.J. Lu <hongjiu.lu@intel.com>
2+
3+ Backport from master
4+ 2016-01-28 H.J. Lu <hongjiu.lu@intel.com>
5+
6+ PR binutils/19523
7+ * Makefile.am (check-DEJAGNU): Pass CC and CC_FOR_BUILD to
8+ runtest.
9+ * Makefile.in: Regenerated.
10+ * testsuite/binutils-all/compress.exp (test_gnu_debuglink): New
11+ proc.
12+ Run test_gnu_debuglink for native ELF build.
13+
114 2016-03-09 Nick Clifton <nickc@redhat.com>
215
316 PR binutils/19775
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -192,6 +192,7 @@ check-DEJAGNU: site.exp
192192 EXPECT=$(EXPECT); export EXPECT; \
193193 runtest=$(RUNTEST); \
194194 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
195+ CC="$(CC)" CC_FOR_BUILD="$(CC_FOR_BUILD)" \
195196 CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \
196197 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
197198 $(RUNTESTFLAGS); \
--- a/binutils/Makefile.in
+++ b/binutils/Makefile.in
@@ -1290,6 +1290,7 @@ check-DEJAGNU: site.exp
12901290 EXPECT=$(EXPECT); export EXPECT; \
12911291 runtest=$(RUNTEST); \
12921292 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
1293+ CC="$(CC)" CC_FOR_BUILD="$(CC_FOR_BUILD)" \
12931294 CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \
12941295 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
12951296 $(RUNTESTFLAGS); \
--- a/binutils/testsuite/binutils-all/compress.exp
+++ b/binutils/testsuite/binutils-all/compress.exp
@@ -667,4 +667,97 @@ if { ([istarget "x86_64-*-elf*"]
667667
668668 set testname "Convert x32 object to x86-64 (3)"
669669 convert_test "$testname" "--nocompress-debug-sections --x32" "-O elf64-x86-64 --compress-debug-sections=zlib-gnu"
670- }
670+}
671+
672+proc test_gnu_debuglink {} {
673+ global srcdir
674+ global subdir
675+ global env
676+ global CC_FOR_TARGET
677+ global STRIP
678+ global OBJCOPY
679+ global OBJDUMP
680+
681+ set test "gnu-debuglink"
682+ if {![info exists CC_FOR_TARGET]} {
683+ set CC_FOR_TARGET $env(CC)
684+ }
685+ if { $CC_FOR_TARGET == "" } {
686+ unsupported $test
687+ return
688+ }
689+
690+ if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog exectuable debug] != "" } {
691+ fail "$test (build)"
692+ return
693+ }
694+ set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.dump"]
695+ if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
696+ fail "$test (objcopy dump)"
697+ return
698+ }
699+ if { [binutils_run $STRIP "--strip-debug --remove-section=.comment --remove-section=.note tmpdir/testprog -o tmpdir/testprog.strip"] != "" } {
700+ fail "$test (strip)"
701+ return
702+ }
703+ if { [binutils_run $OBJCOPY "--only-keep-debug --decompress-debug-sections tmpdir/testprog tmpdir/testprog.decompress"] != "" } {
704+ fail "$test (objcopy decompress)"
705+ return
706+ }
707+ if { [binutils_run $OBJCOPY "--only-keep-debug --compress-debug-sections tmpdir/testprog tmpdir/testprog.compress"] != "" } {
708+ fail "$test (objcopy compress)"
709+ return
710+ }
711+ if { [binutils_run $OBJCOPY "--add-gnu-debuglink=tmpdir/testprog.decompress tmpdir/testprog.strip tmpdir/testprog"] != "" } {
712+ fail "$test (objcopy link decompress)"
713+ return
714+ }
715+ set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.decompress.dump"]
716+ if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
717+ fail "$test (objcopy dump decompress)"
718+ return
719+ }
720+ if { [binutils_run $OBJCOPY "--add-gnu-debuglink=tmpdir/testprog.compress tmpdir/testprog.strip tmpdir/testprog"] != "" } {
721+ fail "$test (objcopy link compress)"
722+ return
723+ }
724+ set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.compress.dump"]
725+ if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
726+ fail "$test (objcopy dump compress)"
727+ return
728+ }
729+
730+ set src1 tmpdir/testprog.dump
731+ set src2 tmpdir/testprog.compress.dump
732+ send_log "cmp ${src1} ${src2}\n"
733+ verbose "cmp ${src1} ${src2}"
734+ set status [remote_exec build cmp "${src1} ${src2}"]
735+ set exec_output [lindex $status 1]
736+ set exec_output [prune_warnings $exec_output]
737+ if ![string match "" $exec_output] then {
738+ send_log "$exec_output\n"
739+ verbose "$exec_output" 1
740+ fail "$test (objdump 1)"
741+ } else {
742+ pass "$test (objdump 1)"
743+ }
744+
745+ set src1 tmpdir/testprog.decompress.dump
746+ set src2 tmpdir/testprog.compress.dump
747+ send_log "cmp ${src1} ${src2}\n"
748+ verbose "cmp ${src1} ${src2}"
749+ set status [remote_exec build cmp "${src1} ${src2}"]
750+ set exec_output [lindex $status 1]
751+ set exec_output [prune_warnings $exec_output]
752+ if ![string match "" $exec_output] then {
753+ send_log "$exec_output\n"
754+ verbose "$exec_output" 1
755+ fail "$test (objdump 2)"
756+ } else {
757+ pass "$test (objdump 2)"
758+ }
759+}
760+
761+if {[isnative] && [is_elf_format]} then {
762+ test_gnu_debuglink
763+}