diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-07-20 10:14:26 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-07-20 10:14:35 -0700 |
commit | f54f5e31ce1270a1e9441348d6f2ea2426352478 (patch) | |
tree | dffa1a2be78618248f313b59bbbbed363917273d /gold/layout.cc | |
parent | a3b5281eb93f986e9865a099c554156c40e4a686 (diff) | |
download | binutils-f54f5e31ce1270a1e9441348d6f2ea2426352478.zip binutils-f54f5e31ce1270a1e9441348d6f2ea2426352478.tar.gz binutils-f54f5e31ce1270a1e9441348d6f2ea2426352478.tar.bz2 |
Clear SHF_COMPRESSED flag bit from input to output
For relocatable link, we should clear the SHF_COMPRESSED flag bit from
input group section.
PR gold/18689
* layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
from input group section for relocatable link.
* testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
(check_DATA): Add pr18689.stdout.
(MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
(pr18689.stdout): New rule.
(pr18689a.o): Likewise.
(pr18689b.o): Likewise.
(pr18689.o): Likewise.
* testsuite/pr18689.c: New file.
* testsuite/pr18689.sh: Likewise.
* testsuite/Makefile.in: Regenerated.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r-- | gold/layout.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc index 142fd90..b454c10 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -1160,8 +1160,12 @@ Layout::layout(Sized_relobj_file<size, big_endian>* object, unsigned int shndx, if (parameters->options().relocatable() && (shdr.get_sh_flags() & elfcpp::SHF_GROUP) != 0) { + // Some flags in the input section should not be automatically + // copied to the output section. + elfcpp::Elf_Xword flags = (shdr.get_sh_flags() + & ~ elfcpp::SHF_COMPRESSED); name = this->namepool_.add(name, true, NULL); - os = this->make_output_section(name, sh_type, shdr.get_sh_flags(), + os = this->make_output_section(name, sh_type, flags, ORDER_INVALID, false); } else |