As a non-private function, it shouldn't have a "_bfd_" prefix, but merely
a "bfd_" one. Hence commit 50efe229dd ("bfd/ELF: mark internal functions
hidden") also wrongly added ATTRIBUTE_HIDDEN to it.
It seems that glob patterns no longer work in the test suite, at least
on some host/dejagnu/shell combinations. In any case it is better
here not to create a single relax-7?.o file from the two source files,
but to create two separate objects for linking.
ld/
* testsuite/ld-h8300/relax-7.d: Replace the glob pattern with
multiple "source" options.
Signed-off-by: Jan Dubiec <jdx@o2.pl>
Addressing (an old) review comment suggesting this housekeeping item.
Use consistent naming style in libsframe. sframe_decoder_ctx objects
are named 'dctx', so use 'ectx' for sframe_encoder_ctx objects.
Make necessary changes in all the applicable declarations and definitions.
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
With test-case gdb.trace/mi-trace-frame-collected.exp I run into:
...
gdb compile failed, gdb.trace/actions.c: In function 'main':
gdb.trace/actions.c:139:1: warning: old-style function definition \
[-Wold-style-definition]
139 | main (argc, argv, envp)
| ^~~~
...
Fix this by rewriting main into a prototyped function.
Tested on x86_64-linux.
PR testsuite/32756
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32756
Adjust the sanity checks for flip_fde workflow and optional trailing
section padding to account for the case of ihp->sfh_fdeoff != 0 or
ihp->sfh_freoff != total FDEs size.
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
libsframe/
* sframe.c (flip_sframe): Fix checks in flip_fde to accommodate
cases when sfh_fdeoff != 0 or when SFrame FREs are placed after
a gap from SFrame FDEs.
In test-case gdb.base/callfuncs.exp I run into:
...
gdb compile failed, gdb.base/callfuncs.c: In function 't_func_values':
gdb.base/callfuncs.c:611:12: error: too many arguments to function \
'func_arg1'; expected 0, have 2
611 | return ((*func_arg1) (5,5) == (*func_val1) (5,5)
| ~^~~~~~~~~~~ ~
...
Fix this by using -std=c99.
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/32756
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32756
Update readelf to display the base symbol version as
Symbol table for image contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar@@
2: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS VERS_1
3: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar@@VERS_1
4: 0000000000003000 0 OBJECT GLOBAL DEFAULT 10 foo@
instead of
Symbol table for image contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar
2: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS VERS_1
3: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar@@VERS_1
4: 0000000000003000 0 OBJECT GLOBAL DEFAULT 10 foo
That is bar@@ and foo@ vs bar and foo.
binutils/
PR binutils/33599
* readelf.c (process_version_sections): Replace 0x8001 with
(VERSYM_HIDDEN | VERSYM_BASE).
(get_symbol_version_string): Likewise. Return "" for the base
version.
include/
PR binutils/33599
* elf/common.h (VERSYM_BASE): New.
ld/
PR binutils/33599
* testsuite/ld-elf/pr33599.d: New file.
* testsuite/ld-elf/pr33599.map: Likewise.
* testsuite/ld-elf/pr33599.s: Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
I'm seeing this FAIL with the native-extended-gdbserver board:
(gdb) add-inferior^M
[New inferior 2]^M
Added inferior 2 on connection 1 (extended-remote localhost:2365)^M
(gdb) FAIL: gdb.python/py-parameter.exp: test_per_inferior_parameters: add-inferior
This is another case of add-inferior producing more output when
connected to a remote target. Adjust the regexp to accomodate it.
Change-Id: Ic5760ff66712c54b90b9debf379dcbf6e07f6eeb
I see this FAIL when running with the native-extended-gdbserver board:
Expecting: ^(-add-inferior[^M
]+)?(.*\^done,inferior="i2"[^M
]+[(]gdb[)] ^M
[ ]*)
-add-inferior^M
=thread-group-added,id="i2"^M
~"[New inferior 2]\n"^M
~"Added inferior 2 on connection 1 (extended-remote localhost:2345)\n"^M
^done,inferior="i2",connection={number="1",name="extended-remote"}^M
(gdb) ^M
FAIL: gdb.mi/set-show.exp: test_per_inferior_parameters: add inferior (unexpected output)
This is another case of the add-inferior command producing more output
when connected to a remote target. Adjust the regexp to accomodate it.
Change-Id: Ifa0590211fd75d4a01dff942c6bb810d5caf1257
We had a customer bug report which was eventually tracked down to
gdbserver not fully sending a target description to gdb. (This
presented as a timeout on the gdb side.)
The customer was using the WINAPI code, which does this:
# define write(fd, buf, len) send (fd, (char *) buf, len, 0)
In this setup, I think it's possible to have a partial write.
However, gdbserver does not account for this possibility, despite the
fact that write_prim documents this.
This patch attempts to fix the problem by always writing the full
buffer in write_prim. In this case the customer fixed their bug in a
different way, so we haven't actually tested this in the wild.
v2: Return bool from write_prim.
Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
Make the field private to make it clear it is never meant to change.
Pass its value through the constructor, and add a getter. The only
place that passes true is the signature_type constructor.
Change-Id: Ifb76bc015bca16696fd66cdf45c048b4ba713479
Approved-By: Tom Tromey <tom@tromey.com>
Except for the m_length field, that is already private and has a setter,
make the fields whose values are passed through the constructor private.
The idea is that their values should be constant throughout the life of
the object. Add some getters and update the callers.
I wasn't sure if making some bitfields public and some private would
change how they are packed, so I checked with "ptype/o", it does not.
Change-Id: I7087bebf69e44d16a36c1dd4d7edf9b8bf085343
Approved-By: Tom Tromey <tom@tromey.com>
I thought that this comment could be updated to clarify what this vector
holds and what it is used for.
Change-Id: I0e1968c8c6455b49aa156669c43ea8c436c59e45
Approved-By: Tom Tromey <tom@tromey.com>
This reverts commit 5e648fc6a0, since it
breaks the GDB build:
CXX elfread.o
/home/smarchi/src/binutils-gdb/gdb/elfread.c: In function ‘symfile_segment_data_up elf_symfile_segments(bfd*)’:
/home/smarchi/src/binutils-gdb/gdb/elfread.c:145:12: error: ‘is_debuginfo_file’ was not declared in this scope
145 | if (!is_debuginfo_file (abfd)
| ^~~~~~~~~~~~~~~~~
Change-Id: I180a9f6936365c365a853c7dae2af01f5207a84e
I see this failure:
$ make check TESTS="gdb.base/with.exp" RUNTESTFLAGS="--target_board=native-extended-gdbserver"
FAIL: gdb.base/with.exp: repeat: reinvoke with no previous command to relaunch
It seems like that failure has always been there and I didn't notice?
I'm not sure what is the intent of the test exactly. It sounds like it
is meant to test what happens when you use command "with language ada"
as the very first command of a GDB session? However, clean_restart and
gdb_load issue some commands before that test. The different between
the native-extended-gdbserver board and the other boards is: for other
boards, the previous command is a "file" command, which is a "no repeat"
command, which gives the expected error message. With the
native-extended-gdbserver board, the previous command is "set remote
exec-file", which is a repeatable command.
"Fix" it by making a "no repeat" command just before the test, so that
it works the same regardless of the target board.
Change-Id: I254faf196f49e9efd492fc9dd5f6ce7b96f72af7
Approved-By: Tom Tromey <tom@tromey.com>
C standard gnu23 introduces a new keyword 'thread_local'.
So, this variables must be renamed to avoid build errors.
Approved-By: Tom Tromey <tom@tromey.com>
Symbols defined in PIE should be bound locally, the same as -shared
-Bsymbolic.
Port x86 commit 4e0c91e454 ("Bind defined symbol locally in PIE")
change of relocate_section as well as linker tests to s390. Similar as
done for other architectures with the following commits:
- AArch64: ac33b731d2 ("[AArch64] Bind defined symbol locally in PIE")
- ARM: 1dcb9720d6 ("[ARM] Bind defined symbol locally in PIE")
- RISC-V: 39c7793ba8 ("RISC-V: Bind defined symbol locally in PIE")
- x86: 4e0c91e454 ("Bind defined symbol locally in PIE")
With this change symbols defined in an executable (i.e. PDE or PIE) are
bound locally, as they cannot be interposed. In the same way as symbols
defined in a shared library linked with -Bsymbolic are bound locally.
This also ensures that all defined symbols are bound locally in
static PIE.
Do not port the x86 change of check_relocs (now scan_relocs). None of
the linker tests where the change in condition triggers (e.g. bootstrap,
cdtest) produce different readelf -Wa output. The change appears to
affect accounting of space required for dynamic relocations. Instead of
accounting them in check_relocs and later filtering them away in
allocate_dynrelocs, they would not get accounted in the first place:
The change in the expression would only have an effect if the following
conditions are all met in addition to PIE: ALLOC, PC-relative
relocation, global symbol, not defined weak, and defined regular. In
this specific case the accounting of the PC relative relocation in
h->dyn_relocs would be skipped for PIE. But allocate_dynrelocs later
eliminates any PC-relative dynamic relocations if PIC (= PIE or shared
library) and SYMBOL_CALLS_LOCAL.
bfd/
PR ld/33141
* elf64-s390.c (elf_s390_relocate_section): Bind defined symbol
locally in PIE.
ld/testsuite/
PR ld/33141
* ld-s390/s390.exp: Add pr33141 tests.
* ld-s390/pr33141.rd: New file.
* ld-s390/pr33141a.s: Likewise.
* ld-s390/pr33141b.s: Likewise.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
As a non-private function, it shouldn't have "_bfd_" prefixes, but merely
a "bfd_" one. Even if, sadly, it needs exposing just for the sake for
VxWorks.
As a non-private data item, it shouldn't have a "_bfd_" prefix, but merely
a "bfd_" one. Furthermore, as being x86-only (forever since its
introduction), it doesn't need to be present in libbfd.{a,so} at all for
other targets.
This reduces the dynamic symbol table a little.
Also drop the ppc_elf_section_processing() declaration, as its definition
was dropped almost 10 years ago.
This reduces the dynamic symbol table quite a bit (almost 200 symbols) and
allows the compiler to be more aggressive about inlining (as it sees fit,
of course).