This won't have any useful effect, so is at best marginally less bogus
than a negative value.
The change actually points out a flawed (for Arm) testcase: @ is a
comment character there.
GCC trunk now defaults to -std=gnu23. We return false in a few places
which can't work when true/false are a proper type (_Bool). Return NULL
where appropriate instead of false. All callers handle this appropriately.
ChangeLog:
PR ld/32372
* prdbg.c (visibility_name): Return NULL.
Since QEMU have supported -Max option to to enable all normal extensions,
the dis-assembler should also add an option, -M,max to do the same thing.
For the instruction, which have overlapped encodings like zfinx, will not
be considered by the -M,max option.
opcodes/
* riscv-dis.c (all_ext): New static boolean. If set, disassemble
without checking architectire string.
(riscv_disassemble_insn): Likewise.
(parse_riscv_dis_option_without_args): Recognized -M,max option.
binutils/
* NEWS: Updated.
The noxfail option is useful in situations like pr23658-1e which
fails on all microblaze ELF targets except microblaze-linux. This was
possible to handle by writing a small proc and use that as an xfail
predicate, or painstakingly listing all microblaze ELF targets, but
this is simpler. The patch also fixes some other FAILs and XPASSes of
the pr23658 tests.
binutils/
* testsuite/lib/binutils-common.exp (run_dump_test): Support
noxfail.
ld/
* testsuite/ld-elf/pr23658-1a.d: Don't xfail m68hc12.
* testsuite/ld-elf/pr23658-1e.d: Likewise. xfail xstormy16
and correct microblaze xfails.
While for executables properly aligning sections within the file can be
quite relevant, the same is of pretty little importance for relocatable
object files. Avoid passing "true" into
_bfd_elf_assign_file_position_for_section() when dealing with object
files, but compensate minimally by applying log_file_align in such
cases as a cap to the alignment put in place.
Commit 68bbe11833 results in a lot of follow up work, much of which
likely is still to be done. (And yes, since this is all for corrupted
or fuzzed object files, a whole lot of work doesn't much benefit
anyone. It was a bad idea to put NULL in asymbol->name.) So I'm
changing the approach to instead put a unique empty string for symbols
with a corrupted st_name. An empty string won't require much work to
ensure nm, objcopy, objdump etc. won't crash, since these tools
already must work with unnamed local symbols.
The unique empty string is called bfd_symbol_error_name. This patch
uses that name string for corrupted symbols in the ELF and COFF
backends. Such symbols are displayed by nm and objdump as the
translated string "<corrupt>", which is what the COFF backend used to
put directly into corrupted symbols.
ie. it's the way I should have written the original patch, plus a few
tides and cleanups I retained from the reverted patches.
For some reason, dlltool supports mcore-elf input files.
* dlltool.c (filter_symbols): Drop symbols with NULL names.
(identify_member_contains_symname): Don't consider symbols
with NULL names.
He/she cannot be reached at the given address anymore, and the name is
apparently too common to identify the person to attempt to establish
another contact. Sadly this orphans the CR16 and CRx ports.
This also makes the dlltool tests run more PE targets, finding that
sh-pe dlltool reports "Machine 'sh' not supported". I guess no one
cares about that.
PR19459
* dlltool.c (asm_prefix): Remove "mach" parameter. Return
leading_underscore independent of machine.
(ASM_PREFIX): Adjust.
* testsuite/binutils-all/dlltool.exp: Run on any target
satisfying is_pecoff_format for which dlltool is built.
Revert commit 0398b8d6c8. Remove target_xfail.
This patch tidies dlltool code dealing with adding a leading
underscore to generated symbol names. There should be no functional
change here, but there could be if we ever have a bfd target with
symbol_leading_char something other than '_' or 0.
* dlltool.c (leading_underscore): Change from an int to a
char*. Update all uses. If neither --leading-underscore or
--no=leading-underscore is given, set leading_underscore to a
string with first char returned by bfd_get_target_info as the
target's symbol underscoring.
It doesn't make much sense trying to print line numbers for what are
usually broken symbols, and there is a possibility of a segfault if
we pass strcmp a NULL.
Allow for "snnnnn.o" suffix when testing against NAME_MAX, and tidy
TMP_STUB handling by overwriting a prior nnnnn.o string rather than
copying the entire name.
* dlltool.c (TMP_STUB): Add "nnnnn.o" to format.
(make_one_lib_file): Localise variables. Don't copy TMP_STUB,
overwrite suffix instead.
(gen_lib_file): Similarly.
(main): Allow for max suffix when testing against NAME_MAX.
Previous code included the full $srcdir pathnames in the individual
subtest PASS/FAIL names, which makes it difficult to compute
comparisons or regressions between test runs on different machines.
This version switches to the basename only, which are common.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* dwarf.c (get_type_abbrev_from_form): Make uvalue param a
uint64_t. Localise variables. Don't bother clearing *data_return
and *addrev_num_return for a NULL return value.
During the execution of the command: i686-w64-mingw32-dlltool
--input-def $def_filepath --output-delaylib $filepath --dllname qemu.exe
An error occurred:
i686-w64-mingw32-dlltool: failed to open temporary head file: ..._w64_mingw32_nativesdk_qemu_8_2_2_build_plugins_libqemu_plugin_api_a_h.s
Due to the path length exceeding the Linux system's file name length
limit (NAME_MAX=255), the temporary file name generated by the
i686-w64-mingw32-dlltool command becomes too long to open. To address
this, a new temporary file name prefix is generated using tmp_prefix =
prefix_encode ("d", getpid()), ensuring that the file name does not
exceed the system's length limit.
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
Reviewed-by: Alan Modra <amodra@gmail.com>
get_type_abbrev_from_form is lax in not limiting data for a uleb to
the current CU, because DW_FORM_ref_addr allows access to other CU's
data. This can lead to an assertion fail when skipping or reading
attributes in get_type_signedness.
* dwarf.c (get_type_abbrev_from_form): Limit uleb data to map end
for ref_addr, cu_end otherwise.
Add the MT ASE instruction operand types and encodings to the microMIPS
opcode table and enable the assembly of these instructions in GAS from
MIPSr2 onwards. Update the binutils and GAS testsuites accordingly.
References:
"MIPS Architecture for Programmers, Volume IV-f: The MIPS MT Module for
the microMIPS32 Architecture", MIPS Technologies, Inc., Document Number:
MD00768, Revision 1.12, July 16, 2013
Co-Authored-By: Maciej W. Rozycki <macro@redhat.com>
Change 2.42 to 2.43 for binutils 2.43 NEWS entries.
binutils/
* NEWS: Change 2.42 to 2.43 for 2.43 NEWS entries.
ld/
* NEWS: Change 2.42 to 2.43 for 2.43 NEWS entries.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
The new test wasn't being run, and failed due to relocations against
.gnu.build.attributes being stripped by default strip behaviour.
We probably should be keeping these relocations, but I haven't made
that change here.
BTW, the new test fails on ia64-hpux but that's just a repeat of the
existing note-5 fail.
PR 31999
* testsuite/binutils-all/strip-16.d: strip with --strip-unneeded
and --merge-notes.
* testsuite/binutils-all/objcopy.exp: Run the new test. Sort
other strip tests.
A number of instructions in the regular MIPS opcode table are assembly
idioms for the MT thread context move MFTR and MTTR instructions, so
mark them as aliases accordingly. Add suitable test cases, which also
cover the PAUSE assembly idiom.
This patch started life as a relatively simple change to fix some
unimportant objcopy memory leaks, but expanded into a larger patch
when I was annoyed by the awkwardness of passing data when using
bfd_map_over_sections. A simple loop over sections is much more
convenient, and we really don't need the abstraction layer. Sections
in a list isn't going to disappear any time soon.
The patch also removes use of the global "status" variable by all but
the top-level functions called from main.
* objcopy.c (filter_symbols): Return success as a bool. Pass
symcount as a pointer, updated on return.
(merge_gnu_build_notes): Similarly return a bool and add newsize
param with updated smaller section size.
(setup_bfd_headers): Return bool success rather than setting
"status" on failure.
(setup_section): Likewise.
(copy_relocations_in_section, copy_section): Likewise, and adjust
params.
(mark_symbols_used_in_relocations): Likewise, and free memory
on failure path. Don't call bfd_fatal.
(get_sections): Delete function.
(copy_object): Don't use bfd_map_over_sections, instead use a
loop allowing easy detection of failure status. Free memory on
error paths.
(copy_archive): Return bool success rather than setting "status"
on failure.
(copy_file): Set "status" here.
* testsuite/binutils-all/strip-13.d: Adjust to suit.
The logic is same as a71d876801 ("aarch64: Add DT_RELR support").
As LoongArch does not have -z dynamic-undefined-weak, we don't need to
consider UNDEFWEAK_NO_DYNAMIC_RELOC.
The linker relaxation adds another layer of complexity. When we delete
bytes in a section during relaxation, we need to fix up the offset in
the to-be-packed relative relocations against this section.
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
I think FILE symbols are special, and I can't see why anyone would
want them to be made global. The fact that no one has reported this
bug since commit 7b4a0685e8 in 2005 supports that claim.
PR 31941
* objcopy.c (filter_symbols): Don't allow BSF_FILE symbols to
be made global.