Skip debug sections when estimating distances
Skip debug sections when estimating distances between output sections since compressed_size is used to compress debug sections and debug sections aren't excluded from distances between output sections. bfd/ PR ld/20006 * elf64-x86-64.c (elf_x86_64_convert_load): Skip debug sections when estimating distances between output sections. ld/ PR ld/20006 * testsuite/ld-elfvsb/elfvsb.exp (COMPRESS_LDFLAG): New. (visibility_run): Pass COMPRESS_LDFLAG to visibility_test on ELF targets.
This commit is contained in:
parent
11cf4ffb5e
commit
91f8bf69a5
|
@ -1,3 +1,9 @@
|
||||||
|
2016-04-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
PR ld/20006
|
||||||
|
* elf64-x86-64.c (elf_x86_64_convert_load): Skip debug sections
|
||||||
|
when estimating distances between output sections.
|
||||||
|
|
||||||
2016-04-27 Alan Modra <amodra@gmail.com>
|
2016-04-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elflink.c (_bfd_elf_is_start_stop): New function.
|
* elflink.c (_bfd_elf_is_start_stop): New function.
|
||||||
|
|
|
@ -3205,17 +3205,20 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec,
|
||||||
for (asect = link_info->output_bfd->sections;
|
for (asect = link_info->output_bfd->sections;
|
||||||
asect != NULL;
|
asect != NULL;
|
||||||
asect = asect->next)
|
asect = asect->next)
|
||||||
{
|
/* Skip debug sections since compressed_size is used to
|
||||||
asection *i;
|
compress debug sections. */
|
||||||
for (i = asect->map_head.s;
|
if ((asect->flags & SEC_DEBUGGING) == 0)
|
||||||
i != NULL;
|
{
|
||||||
i = i->map_head.s)
|
asection *i;
|
||||||
{
|
for (i = asect->map_head.s;
|
||||||
size = align_power (size, i->alignment_power);
|
i != NULL;
|
||||||
size += i->size;
|
i = i->map_head.s)
|
||||||
}
|
{
|
||||||
asect->compressed_size = size;
|
size = align_power (size, i->alignment_power);
|
||||||
}
|
size += i->size;
|
||||||
|
}
|
||||||
|
asect->compressed_size = size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't convert GOTPCREL relocations if TSEC isn't placed
|
/* Don't convert GOTPCREL relocations if TSEC isn't placed
|
||||||
|
|
13
ld/ChangeLog
13
ld/ChangeLog
|
@ -1,8 +1,15 @@
|
||||||
2016-04-27 H.J. Lu <hongjiu.lu@intel.com>
|
2016-04-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* ld-elf/compressed1b.d: Pass --compress-debug-sections=none
|
PR ld/20006
|
||||||
to ld.
|
* testsuite/ld-elfvsb/elfvsb.exp (COMPRESS_LDFLAG): New.
|
||||||
* ld-elf/compressed1c.d: Likewise.
|
(visibility_run): Pass COMPRESS_LDFLAG to visibility_test on
|
||||||
|
ELF targets.
|
||||||
|
|
||||||
|
2016-04-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* testsuite/ld-elf/compressed1b.d: Pass
|
||||||
|
--compress-debug-sections=none to ld.
|
||||||
|
* testsuite/ld-elf/compressed1c.d: Likewise.
|
||||||
|
|
||||||
2016-04-27 Alan Modra <amodra@gmail.com>
|
2016-04-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ if ![isnative] then {return}
|
||||||
set tmpdir tmpdir
|
set tmpdir tmpdir
|
||||||
set SHCFLAG ""
|
set SHCFLAG ""
|
||||||
set shared_needs_pic "no"
|
set shared_needs_pic "no"
|
||||||
|
set COMPRESS_LDFLAG "-Wl,--compress-debug-sections=zlib-gabi"
|
||||||
|
|
||||||
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
||||||
|
|
||||||
|
@ -228,6 +229,7 @@ proc visibility_run {visibility} {
|
||||||
global support_protected
|
global support_protected
|
||||||
global shared_needs_pic
|
global shared_needs_pic
|
||||||
global PLT_CFLAGS
|
global PLT_CFLAGS
|
||||||
|
global COMPRESS_LDFLAG
|
||||||
|
|
||||||
if [ string match $visibility "hidden" ] {
|
if [ string match $visibility "hidden" ] {
|
||||||
set VSBCFLAG "-DHIDDEN_TEST"
|
set VSBCFLAG "-DHIDDEN_TEST"
|
||||||
|
@ -384,7 +386,7 @@ proc visibility_run {visibility} {
|
||||||
} else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
} else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
||||||
visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff
|
visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff
|
||||||
} else {
|
} else {
|
||||||
visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb
|
visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb $COMPRESS_LDFLAG
|
||||||
} }
|
} }
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in New Issue