mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 18:44:20 +08:00
Don't compress empty debug section
2012-07-03 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14319 * elf.c (_bfd_elf_make_section_from_shdr): Don't compress empty debug section. 2012-07-03 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14319 * binutils-all/compress.exp: Test compress empty debug sections. * binutils-all/dw2-empty.S: New file.
This commit is contained in:
parent
1e55e04f56
commit
5a5ed5b0e4
@ -1,3 +1,9 @@
|
||||
2012-07-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR binutils/14319
|
||||
* elf.c (_bfd_elf_make_section_from_shdr): Don't compress empty
|
||||
debug section.
|
||||
|
||||
2012-07-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/3351
|
||||
|
@ -1025,7 +1025,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
|
||||
else
|
||||
{
|
||||
/* Normal section. Check if we should compress. */
|
||||
if ((abfd->flags & BFD_COMPRESS))
|
||||
if ((abfd->flags & BFD_COMPRESS) && newsect->size != 0)
|
||||
action = compress;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
2012-07-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR binutils/14319
|
||||
* binutils-all/compress.exp: Test compress empty debug sections.
|
||||
|
||||
* binutils-all/dw2-empty.S: New file.
|
||||
|
||||
2012-06-07 Thomas Schwinge <thomas@codesourcery.com>
|
||||
|
||||
* binutils-all/i386/i386.exp: Don't skip for x86_64-*-linux*.
|
||||
|
@ -133,3 +133,32 @@ if ![string match "" $got] then {
|
||||
pass "$testname"
|
||||
}
|
||||
}
|
||||
|
||||
set testfile tmpdir/dw2-emty.o
|
||||
|
||||
if { ![binutils_assemble_flags $srcdir/$subdir/dw2-empty.S $testfile --nocompress-debug-sections] } then {
|
||||
unsupported "compressed debug sections"
|
||||
return
|
||||
}
|
||||
|
||||
set testname "objcopy compress empty debug sections"
|
||||
set got [binutils_run $OBJCOPY "--compress-debug-sections $testfile ${copyfile}.o"]
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy ($testname)"
|
||||
} else {
|
||||
send_log "cmp $testfile ${copyfile}.o\n"
|
||||
verbose "cmp $testfile ${copyfile}.o"
|
||||
set src1 ${testfile}
|
||||
set src2 ${copyfile}.o
|
||||
set status [remote_exec build cmp "${src1} ${src2}"]
|
||||
set exec_output [lindex $status 1]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
|
||||
if [string match "" $exec_output] then {
|
||||
pass "objcopy ($testname)"
|
||||
} else {
|
||||
send_log "$exec_output\n"
|
||||
verbose "$exec_output" 1
|
||||
fail "objcopy ($testname)"
|
||||
}
|
||||
}
|
||||
|
1
binutils/testsuite/binutils-all/dw2-empty.S
Normal file
1
binutils/testsuite/binutils-all/dw2-empty.S
Normal file
@ -0,0 +1 @@
|
||||
.section .debug_line
|
Loading…
Reference in New Issue
Block a user