PR target/19938
bfd * elf-bbfd.h (struct elf_backend_data): New field:
elf_strtab_flags.
New field: elf_backend_set_special_section_info_and_link
* elfxx-target.h (elf_backend_strtab_flags): Define if not already
defined.
(elf_backend_set_special_section_info_and_link): Define if not
already defined.
(elfNN_bed): Use elf_backend_set_special_section_info_and_link and
elf_backend_strtab_flags macros to initialise fields in structure.
* elf.c (_bfd_elf_make_section_from_shdr): Check for SHF_STRINGS
being set even if SHF_MERGE is not set.
(elf_fake_sections): Likewise.
(section_match): New function. Matches two ELF sections based
upon fixed characteristics.
(find_link): New function. Locates a section in a BFD that
matches a section in a different BFD.
(_bfd_elf_copy_private_bfd_data): Copy the sh_info and sh_link
fields of reserved sections.
(bfd_elf_compute_section_file_positions): Set the flags for the
.shstrtab section based upon the elf_strtab_flags field in the
elf_backend_data structure.
(swap_out_syms): Likewise for the .strtab section.
* elflink.c (bfd_elf_final_link): Set the flags for the
.strtab section based upon the elf_strtab_flags field in the
elf_backend_data structure.
* elf32-i386.c (elf32_i386_set_special_info_link): New function.
(elf_backend_strtab_flags): Set to SHF_STRINGS for Solaris
targets.
(elf_backend_set_special_section_info_and_link): Define for
Solaris targets.
* elf32-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
binutils* testsuite/binutils-all/i386/compressed-1b.d: Allow for the
string sections possibly having the SHF_STRINGS flag bit set.
* testsuite/binutils-all/i386/compressed-1c.d: Likewise.
* testsuite/binutils-all/readelf.s: Likewise.
* testsuite/binutils-all/readelf.s-64: Likewise.
* testsuite/binutils-all/x86-64/compressed-1b.d: Likewise.
* testsuite/binutils-all/x86-64/compressed-1c.d: Likewise.
gas * testsuite/gas/i386/ilp32/x86-64-unwind.d: Allow for the string
sections possibly having the SHF_STRINGS flag bit set.
* testsuite/gas/i386/x86-64-unwind.d: Likewise.
This commit restructures the selection of the default cpu/mach so that
the choice is made from md_begin (if the user has not provided a command
line choice). This will reduce the amount of change needed in a later
patch.
At the request of Synopsys, the default architecture changes to ARC700
from this commit, previously the default was a non-existent
super-architecture that contained all instructions from all arc
variants. There's some clean up associated with removing the default
merged architecture, and a small test fix now that the default is
ARC700.
binutils/ChangeLog:
* testsuite/binutils-all/objdump.exp (cpus_expected): Add ARC700
to the architecture list.
gas/ChangeLog:
* config/tc-arc.c (arc_target): Delay initialisation until
arc_select_cpu.
(arc_target_name): Likewise.
(arc_features): Likewise.
(arc_mach_type): Likewise.
(cpu_types): Remove "all" entry.
(arc_select_cpu): New function, most of the content is from...
(md_parse_option): ... here. Call new arc_select_cpu.
(md_begin): Call arc_select_cpu if needed, default is now arc700.
include/ChangeLog:
* opcode/arc.h (ARC_OPCODE_BASE): Delete.
opcodes/ChangeLog:
* arc-opc.c (BASE): Delete.
bfd PR binutils/19775
* archive.c (bfd_generic_openr_next_archived_file): Allow zero
length elements in the archive.
binutils PR binutils/19775
* testsuite/binutils-all/ar.exp (proc empty_archive): New proc.
Run the new proc.
* testsuite/binutils-all/empty: New, empty, file.
The HAS_RELOC bit should be cleared when relocations are removed from
relocatable files.
bfd/
PR binutils/19547
* elf.c (assign_section_numbers): Clear HAS_RELOC if there are
no relocations in relocatable files.
binutils/
PR binutils/19547
* testsuite/binutils-all/objcopy.exp
(objcopy_test_without_global_symbol): New proc.
Run objcopy_test_without_global_symbol.
* testsuite/binutils-all/pr19547.c: New file.
We should set BFD_DECOMPRESS to decompress debug sections when reading in
DWARF debug sections.
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.
When the DWARF address size is 32-bit, but the host machine is 64-bit,
objdump fails to spot base addresses specified in the .debug_ranges and
.debug_loc lists.
As an example, here is the output when dumping an example .debug_ranges
section with the pre-patched objdump:
Contents of the .debug_ranges section:
Offset Begin End
00000000 ffffffff 00000004 (start > end)
00000000 00000000 00000004
00000000 ffffffff 00000008 (start > end)
00000000 00000000 00000004
00000000 <End of list>
And this is what the same section looks like when dumped with the
patched version of objdump:
Contents of the .debug_ranges section:
Offset Begin End
00000000 ffffffff 00000004 (base address)
00000000 00000004 00000008
00000000 ffffffff 00000008 (base address)
00000000 00000008 0000000c
00000000 <End of list>
binutils/ChangeLog:
* dwarf.c (is_max_address): New function.
(display_loc_list): Remove out of date comment, use
is_max_address.
(display_debug_ranges): Likewise.
binutils/testsuite/ChangeLog:
* binutils-all/objdump.exp: Add test for .debug_ranges decode.
* binutils-all/dw2-ranges.S: New file.
* binutils-all/dw2-ranges.W: New file.
PR binutils/19104
binutils * objcopy.c (command_line_switch): Add OPTION_ADD_SYMBOL.
(copy_options): Add add-symbol.
(copy_usage): Likewise.
(parse_symflags): New function.
(need_sym_before): New function.
(create_new_symbol): New function.
(filter_symbols): Add code to insert new symbols.
(copy_main): Process OPTION_ADD_SYMBOL.
* doc/binutils.texi: Document new feature.
* NEWS: Add note about the new feature.
tests * binutils-all/add-symbol.d: New test.
* binutils-all/objcopy.exp: Run the new test.
The main aim of this patch is to perform more objcopy tests when we
can build executables but not run them. ie. non-native with cross
compiler available.
* binutils-all/objcopy.exp: Delete trailing whitespace. Use
"string equal" rather than "string match" when making simple
string comparisons. Revert 2008-07-08 host_triplet checks.
Perform non-run tests when we can build executable.
(strip_executable, strip_executable_with_saving_a_symbol): Move
run test later. Take extra param on whether to perform run test.
Update callers.
(keep_debug_symbols_and_test_copy): Delete unused vars.
We can't use the output section size to copy input section since
--interleave will shrink the output section. Instead, we change
bfd_convert_section_contents to return the updated input section
size. When we do that, we don't need to adjust the output section
size to skip gap fills.
bfd/
PR binutils/19020
* bfd.c (bfd_convert_section_contents): Add ptr_size parameter.
* bfd-in2.h: Regenerated.
binutils/
PR binutils/19020
* objcopy.c (copy_object): Don't adjust the output section size
when copying from input sections.
(copy_section): Use input section size for the copy. Get the
updated section size from bfd_convert_section_contents.
binutils/testsuite/
PR binutils/19020
* binutils-all/objcopy.exp: Run pr19020a and pr19020b.
* lib/utils-lib.exp (run_dump_test): Support binary input.
* binutils-all/pr19020.in: New file.
* binutils-all/pr19020a.d: Likewise.
* binutils-all/pr19020b.d: Likewise.
Some targets provide aligned .bss sections, so explicitly align.
msp430 and rl78 emit "magic" symbols when assembling symbol.s, and
mips targets emit STT_OBJECT rather than STT_NOTYPE syms.
* binutils-all/strip-12.s: Align .bss section.
* binutils-all/strip-12.d: Adjust.
* binutils-all/symbols-1.d: Allow extraneous symbols.
* binutils-all/symbols-2.d: Likewise, and V for weakened syms.
* binutils-all/symbols-3.d: Likewise.
* binutils-all/symbols-4.d: Likewise.
When copying the sh_link and sh_info fields in stripped section headers,
we also check if the sh_type, sh_flags, /sh_addralign and sh_entsize
fields of the output section match the output. Since --only-keep-debug
turns all non-debug sections into SHT_NOBITS sections, the output
SHT_NOBITS type matches any input type.
bfd/
PR binutils/18785
* elf.c (_bfd_elf_copy_private_bfd_data): When copying the
sh_link and sh_info fields in stripped section headers, we also
check if the sh_type, sh_flags, /sh_addralign and sh_entsize
fields of the output section match the output. Since
--only-keep-debug turns all non-debug sections into SHT_NOBITS
sections, the output SHT_NOBITS type matches any input type.
binutils/testsuite/
PR binutils/18785
* binutils-all/objcopy.exp: Run strip-12.
* binutils-all/strip-12.d: New file.
* binutils-all/strip-12.s: Likewise.
When using options such as --localize-symbol, --globalize-symbol, etc,
along with the --wildcard option, prefixing a symbol name with '!'
should provide non-matching behaviour, as example the following example
is given in the manual:
--wildcard --weaken-symbol !foo --weaken-symbol fo*
which should weaken all symbols matching the pattern 'fo*', but not the
symbol 'foo'.
However, this currently does not work, the current logic will waken all
symbols matching the pattern 'fo*' AND all symbols that are not 'foo'.
The symbol 'foo' is covered by the first condition, and so is weakened,
while, other symbols, for example 'bar' will match the second condition,
and so be weakened.
This patch adjusts the logic so that a pattern prefixed with '!'
specifically DOES NOT apply the relevant change to any matching symbols,
instead of applying the change to all non-matching symbols. So this:
--weaken-symbol !foo
will ensure that the symbol 'foo' is not weakened, but says nothing
about symbols that are not 'foo'. As a result, a pattern prefixed with
'!' now only makes sense when used alongside a more wide ranging
wildcard pattern.
This change should make the wildcard matching feature more useful, with
no overall loss of functionality. The example given in the manual,
weaken all symbols matching 'fo*' except 'foo' can now be achieved, but
so too can more complex examples, such as weaken all symbols matching
'fo*' except 'foo', 'foa', and 'fob', like this:
--wildcard --weaken-symbol !foo \
--weaken-symbol !foa \
--weaken-symbol !fob \
--weaken-symbol fo*
Under the previous scheme, something as symbols as, weaken all symbols
except 'foo' could have been achieved with this:
--weaken-symbol !foo
however, this will no longer work. To achieve the same result under the
new scheme this is now required:
--weaken-symbol !foo --weaken-symbol *
binutils/ChangeLog:
* objcopy.c (is_specified_symbol_predicate): Don't stop at first
match. Non-match rules set found to FALSE.
binutils/testsuite/ChangeLog:
* binutils-all/objcopy.exp: Run new symbol tests.
(objcopy_test_symbol_manipulation): New function.
* binutils-all/symbols-1.d: New file.
* binutils-all/symbols-2.d: New file.
* binutils-all/symbols-3.d: New file.
* binutils-all/symbols-4.d: New file.
* binutils-all/symbols.s: New file.
bfd * elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
sh_info fields of sections whose type has been changed to
SHT_NOBITS.
bin * doc/binutils.texi: Document that the --only-keep-debug option
to strip and objcopy preserves the section headers of stripped
sections.
tests * binutils-all/objcopy.exp (keep_debug_symbols_and_check_links):
New proc. Checks that debug-info-only binaries retain the
sh_link field in stripped sections.
gas * config/tc-rl78.c (rl78_abs_sym): New local variable.
(md_begin): Initialise the new symbol.
(OPIMM): Define the value to be relative to the new symbol and not
the absolute section symbol.
ld * emulparams/elf32rl78.sh (OTHER_SECTIONS): Provide a value for
the _-rl78_abs__ symbol.
tests * gas/all/struct.d: Allow for extra symbols in the output.
* gas/macros/test1.d: Likewise.
* gas/elf/elf.exp: Add an rl78 machine.
* gas/elf/sections2e-rl78: New file.
tests * binutils-all/localize-hidden-1.d: Allow for extra symbols in the
output.
* binutils-all/strip-11.d: Skip for the RL78.
All programs in binutils+gdb git repo now support gABI compression
with the SHF_COMPRESSED bit. This patch makes the zlib-gabi option
as compression default for gas, gold, ld and objcopy, instead of the
zlib-gnu option whose outputs are incompatible with gABI.
binutils/
* objcopy.c (copy_file): Set BFD_COMPRESS_GABI if not
zlib-gnu.
* doc/binutils.texi: Change --compress-debug-sections and
--compress-debug-sections=zlib to zlib-gabi.
binutils/testsuite/
* binutils-all/compress.exp: Update.
gas/
* as.c (parse_args): Make --compress-debug-sections and
--compress-debug-sections=zlib the same as
--compress-debug-sections=zlib-gabi.
* doc/as.texinfo: Change --compress-debug-sections and
--compress-debug-sections=zlib to zlib-gabi.
gold/
* compressed_output.cc (Output_compressed_section::set_final_data_size):
Make --compress-debug-sections=zlib the same as
--compress-debug-sections=zlib-gabi.
* testsuite/Makefile.am (flagstest_compress_debug_sections.check):
Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
".zdebug_".
* testsuite/Makefile.in: Regenerated.
ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Make
--compress-debug-sections=zlib the same as
--compress-debug-sections=zlib-gabi.
* ld.texinfo: Change --compress-debug-sections=zlib to zlib-gabi.
ld/testsuite/
* ld-elf/zlibbegin.rS: Updated to .debug_.* with the
SHF_COMPRESSED bit.
* ld-elf/zlibnormal.rS: Likewise.
The output SHF_COMPRESSED section size is different from input if
ELF classes of input and output aren't the same. We must adjust
the section sizes as well as the compression headers in
SHF_COMPRESSED sections when converting objects between different
ELF classes.
bfd/
PR binutils/18656
* bfd.c (bfd_convert_section_size): New function.
(bfd_convert_section_contents): Likewise.
* bfd-in2.h: Regenerated.
binutils/
2015-07-10 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/18656
* objcopy.c (setup_section): Call bfd_convert_section_size
to get the output section size.
(copy_section): Get the section size from the output section
and call bfd_get_full_section_contents to convert section
contents for output.
binutils/testsuite/
PR binutils/18656
* binutils-all/compress.exp (convert_test): New proc.
Run conversion tests between x86-64 and x32.
bin * readelf.c (options): Add "decompress".
(usage): Mention -z/--decompress.
(parse_args): Handle -z.
(uncompress_section_contents): Move to earlier in the file.
(dump_section_as_strings): If requested, decompress the section
before dumping.
(dump_section_as_bytes): Likewise.
* doc/binutils.texi: Document the new option.
tests * binutils-all/z.s: New test. Checks the --decompress option to
readelf.
* binutils-all/readelf.exp: Run the test.
* binutils-all/readelf.z: Expected output from readelf.
PR binutils/18374
bin * dwarf.h (struct dwarf_section): Add reloc_info and num_relocs
fields.
(struct dwarf_section_display): Change bitfield to boolean.
(reloc_at): Add prototype.
* dwarf.c (display_loc_list): Ignore list terminators if there are
relocs against them.
(display_debug_loc): Issue a warning if there are relocs against
the .debug_loc section.
(display_displays): Initialise reloc_info and num_relocs fields.
* objdump.c (load_specific_debug_section): Initialise reloc_info
and num_relocs fields.
(reloc_at): New function.
* readelf.c (is_32bit_abs_reloc): Add IA64's R_IA64_DIS32LSB
reloc.
(reloc_at): New function.
(apply_relocations): Add relocs_return and num_relocs_return
parameters. Fill them in with the loaded relocs if non-NULL.
(dump_section_as_bytes): Update call to apply_relocations.
(load_specific_debug_section): Initialise reloc_info and
num_relocs fields.
tests * binutils-all/pr18374.s: New test file.
* binutils-all/readelf.exp: Assemble and run the new test.
* binutils-all/readelf.pr18374: Expected output from readelf.
In a SHF_COMPRESSED compressed section, the raw compressed data should
begin immediately after the compression header. This patch removes the
extra zlib header from the SHF_COMPRESSED section.
bfd/
* bfd.c (bfd_update_compression_header): Also write the zlib
header if the SHF_COMPRESSED bit cleared..
(bfd_check_compression_header): Return the uncompressed size.
* compress.c (decompress_contents): Don't skip the zlib header.
(bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
which doesn't have the zlib header.
(bfd_init_section_decompress_status): Likewise.
(bfd_get_full_section_contents): Updated.
(bfd_is_section_compressed): Likewise.
(bfd_is_section_compressed_with_header): Return the uncompressed
size.
* elf.c (_bfd_elf_make_section_from_shdr): Updated.
* bfd-in2.h: Regenerated.
binutils/
* readelf.c (uncompress_section_contents): Add a parameter for
uncompressed size. Don't check the zlib header.
(load_specific_debug_section): Updated.
binutils/testsuite/
* binutils-all/compress.exp: Replace "$OBJDUMP -s -j .debug_info"
with "$OBJDUMP -W".
* binutils-all/libdw2-compressedgabi.out: Updated.
gas/
2015-05-14 H.J. Lu <hongjiu.lu@intel.com>
* write.c (compress_debug): Don't write the zlib header, which
is handled by bfd_update_compression_header.
Mixing target and not-target directives can be used to run for x86_64-*-*
target while skipping x86_64-*-gnux32 target. This patch allows mixing
target and not-target directives. It is used to skip elfedit-1 for
x86_64-*-gnux32.
* binutils-all/elfedit-1.d: Skip x86_64-*-gnux32.
* lib/utils-lib.exp (run_dump_test): Allow mixing target and
not-target directives.
binutils/
* elfedit.c (enum elfclass): New.
(input_elf_class): Change type to enum elfclass.
(output_elf_class): New.
(elf_class): Change return type to enum elfclass. Support EM_386
and EM_IAMCU.
(update_elf_header): Check if input and output ELF classes match.
(elf_machine): Support EM_386 and EM_IAMCU.
(main): Update input_elf_class. Set output_elf_class.
* doc/binutils.texi: Update elfedit.
binutils/testsuite/
* binutils-all/elfedit-5.d: New file.
* binutils-all/elfedit.exp: Run elfedit-5.
Change compressed input debug section name for objdump is very confusing.
But we need to change it for linker so that linker will consider the
input section as a debug section. This patch delays section rename to
elf_fake_sections for objcopy and avoids it for objdump.
bfd/
PR binutils/18209
* bfd.c (bfd): Add is_linker_input.
* elf.c (convert_debug_to_zdebug): New.
(convert_zdebug_to_debug): Likewise.
(_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
.zdebug_* here. Use convert_zdebug_to_debug. Set SEC_ELF_RENAME.
(_bfd_elf_init_reloc_shdr): Pass a pointer to section name
instead of a pointer to section.
(elf_fake_sections): Rename the section name if SEC_ELF_RENAME
is set.
* section.c (SEC_ELF_RENAME): New.
* bfd-in2.h: Regenerated.
binutils/
PR binutils/18209
* objcopy.c (setup_section): Copy compress status.
binutils/testsuite/
PR binutils/18209
* binutils-all/compress.exp: Replace dw2-3.W with dw2-3gabi.W
on zlib-gabi output.
* binutils-all/dw2-1.W: Convert section names to .zdebug_*.
* binutils-all/dw2-3.W: Likewise.
* binutils-all/objdump.W: Likewise.
* binutils-all/dw2-3gabi.W: New file.
ld/
PR binutils/18209
* ldfile.c (ldfile_try_open_bfd): Set is_linker_input to 1.
This patch adds --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}
options to gas and objcopy for ELF files. They control how DWARF debug
sections are compressed. --compress-debug-sections=none is equivalent to
--nocompress-debug-sections. --compress-debug-sections=zlib and
--compress-debug-sections=zlib-gnu are equivalent to
--compress-debug-sections. --compress-debug-sections=zlib-gabi compresses
DWARF debug sections with SHF_COMPRESSED from the ELF ABI. No linker
changes are required to support SHF_COMPRESSED.
bfd/
* archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
bit.
* bfd.c (bfd::flags): Increase size to 18 bits.
(BFD_COMPRESS_GABI): New.
(BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
(BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
(bfd_update_compression_header): New fuction.
(bfd_check_compression_header): Likewise.
(bfd_get_compression_header_size): Likewise.
(bfd_is_section_compressed_with_header): Likewise.
* compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
(bfd_compress_section_contents): Return the uncompressed size if
the full section contents is compressed successfully. Support
converting from/to .zdebug* sections.
(bfd_get_full_section_contents): Call
bfd_get_compression_header_size to get compression header size.
(bfd_is_section_compressed): Renamed to ...
(bfd_is_section_compressed_with_header): This. Add a pointer
argument to return compression header size.
(bfd_is_section_compressed): Use it.
(bfd_init_section_decompress_status): Call
bfd_get_compression_header_size to get compression header size.
Return FALSE if uncompressed section size is 0.
* elf.c (_bfd_elf_make_section_from_shdr): Support converting
from/to .zdebug* sections.
* bfd-in2.h: Regenerated.
binutils/
* objcopy.c (do_debug_sections): Add compress_zlib,
compress_gnu_zlib and compress_gabi_zlib.
(copy_options): Use optional_argument on compress-debug-sections.
(copy_usage): Update --compress-debug-sections.
(copy_file): Handle compress_zlib, compress_gnu_zlib and
compress_gabi_zlib.
(copy_main): Handle
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* doc/binutils.texi: Document
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
binutils/testsuite/
* compress.exp: Add tests for
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* binutils-all/dw2-3.rS: New file.
* binutils-all/dw2-3.rt: Likewise.
* binutils-all/libdw2-compressedgabi.out: Likewise.
gas/
* as.c (show_usage): Update --compress-debug-sections.
(std_longopts): Use optional_argument on compress-debug-sections.
(parse_args): Handle
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* as.h (compressed_debug_section_type): New.
(flag_compress_debug): Change type to compressed_debug_section_type.
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* write.c (compress_debug): Set BFD_COMPRESS_GABI for
--compress-debug-sections=zlib-gabi. Call
bfd_get_compression_header_size to get compression header size.
Don't rename section name for --compress-debug-sections=zlib-gabi.
* config/tc-i386.c (compressed_debug_section_type): Set to
COMPRESS_DEBUG_ZLIB.
* doc/as.texinfo: Document
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
gas/testsuite/
* gas/i386/dw2-compressed-1.d: New file.
* gas/i386/dw2-compressed-2.d: Likewise.
* gas/i386/dw2-compressed-3.d: Likewise.
* gas/i386/x86-64-dw2-compressed-2.d: Likewise.
* gas/i386/i386.exp: Run dw2-compressed-2, dw2-compressed-1,
dw2-compressed-3 and x86-64-dw2-compressed-2.
ld/testsuite/
* ld-elf/compress.exp: Add a test for
--compress-debug-sections=zlib-gabi.
(build_tests): Add 2 tests for --compress-debug-sections=zlib-gabi.
(run_tests): Likewise.
Verify linker output with zlib-gabi compressed debug input.
* ld-elf/compressed1a.d: New file.
* ld-elf/compressed1b.d: Likewise.
* ld-elf/compressed1c.d: Likewise.
There is no need to generate compressed debug section if compressed
section size is the same as before compression. We should xfail the
compressed debug section test if there are no compressed sections
binutils/testsuite/
* binutils-all/compress.exp (compression_used): New.
Xfail test if compression didn't make the section smaller.
gas/
2015-04-05 H.J. Lu <hongjiu.lu@intel.com>
* write.c (compress_debug): Don't write the zlib header if
compressed section size is the same as before compression.
2015-03-03 Jiong Wang <jiong.wang@arm.com>
opcode/
* arm-dis.c (arm_symbol_is_valid): Skip ARM private symbols.
binutils/testsuite/
* binutils-all/arm/rvct_symbol.s: New testcase.
* binutils-all/arm/objdump.exp: Run it.
New option for objcopy --update-section allows the contents of a section
to be updated while maintaining the section flags, and, for ELF files,
the section to segment mapping.
New test uses --dump-section and --update-section to check that a
section can be made larger and smaller with an update.
binutils/ChangeLog:
* objcopy.c (update_sections): New list.
(command_line_switch): Add OPTION_UPDATE_SECTION.
(copy_options): Add update-section.
(copy_usage): Document new option.
(is_update_section): New function.
(is_strip_section_1): Add check for attempt to update and remove
the same section.
(copy_object): Update size and content of requested sections.
(skip_section): Don't copy for updated sections.
(copy_main): Handle --update-section.
* doc/binutils.texi (objcopy): Add description of --update-section
option.
* NEWS: Mention --update-section option.
binutils/testsuite/ChangeLog:
* binutils-all/update-1.s: New file.
* binutils-all/update-2.s: New file.
* binutils-all/update-3.s: New file.
* binutils-all/update-4.s: New file.
* binutils-all/update-section.exp: New file.
bfd * elf32-v850.c (v850_set_note): New function. Creates a Renesas
style note entry.
(v850_elf_make_note_section): New function. Creates a note
section.
(v850_elf_create_sections): New function. Create a note section
if one is not already present.
(v850_elf_set_note): New function. Adds a note to a bfd.
(v850_elf_copy_private_bfd_data): New function. Copies V850
notes.
(v850_elf_merge_notes): New function. Merges V850 notes.
(print_v850_note): New function. Displays a V850 note.
(v850_elf_print_notes): New function. Displays all notes attached
to a bfd.
(v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
(v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
(v850_elf_fake_sections): Set the type of the V850 note section.
* bfd-in.h (v850_elf_create_sections): Add prototype.
(v850_elf_set_note): Add prototype.
* bfd-in2.h: Regenerate.
binutils* readelf.c (get_machine_flags): Remove deprecated V850 machine
flags.
(get_v850_section_type_name): New function. Handles V850 special
sections.
(get_section_type_name): Add support for V850.
(get_v850_elf_note_type): New function. Returns the name of a
V850 note.
(print_v850_note): New function. Prints a V850 note.
(process_v850_notes): New function. Prints V850 notes.
(process_note_sections): Add support for V850.
binutils/testsute
* binutils-all/objcopy.exp: Skip the strip-10 test for the V850.
gas * config/tc-v850.c (soft_float): New variable.
(v850_data_8): New variable.
(md_show_usage): Add -msoft-float/-mhard-float.
(md_parse_option): Likewise.
(md_begin): Set the default value of soft_float.
(v850_md_end): New function. Creates a note section.
* config/tc-v850.h (md_end): Define.
* doc/c-v850.texi: Document -msoft-float/-mhard-float.
gas/testsuite
* gas/elf/elf.exp: Add special version of the section2 test for
the V850.
* gas/elf/section2.e-v850: New file.
include/elf
* v850.h (EF_RH850_SIMD): Delete deprecated flag.
(EF_RH850_CACHE): Likewise.
(EF_RH850_MMU): Likewise.
(EF_RH850_DATA_ALIGN8): Likewise.
(SHT_RENESAS_IOP): Fix typo in name.
(SHT_RENESAS_INFO): Define.
(V850_NOTE_SECNAME): Define.
(SIZEOF_V850_NOTE): Define.
(V850_NOTE_NAME): Define.
(enum v850_notes): New enum.
(NUM_V850_NOTES): Define.
ld/ChangeLog
2015-02-24 Nick Clifton <nickc@redhat.com>
* Makefile.am (ev850.c): Add dependency upon
$(srcdir)/emultempl/v850elf.em.
(ev850_rh850.c): Likewise.
* Makefile.in: Regenerate.
* emultempl/v850elf.em: New file.
* emulparams/v850.sh (EXTRA_EM_FILE): Define.
* emulparams/v850_rh850.sh (EXTRA_EM_FILE): Define.
* scripttempl/v850.sc: Add .note.renesas section.
* scripttempl/v850_rh850.sc: Likewise.
ld/testsuite
* ld-elf/extract-symbol-1sec.d: Expect to fail on the V850.
Since 2006, commit d270463e9, _bfd_elf_copy_private_section_data has
copied over SHF_MASKOS and SHF_MASKPROC flags. That makes the buggy
code in sh_elf64_copy_private_data_internal redundant.
bfd/
PR 17755
* elf64-sh64.c (sh_elf64_copy_private_data_internal): Delete code
copying SHF_SH5_ISA32.
binutils/testsuite/
* binutils-all/strip-11.d: New test.
* binutils-all/objcopy.exp: Run it.