• R/O
  • HTTP
  • SSH
  • HTTPS

提交列表

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

RSS
Rev. 时间 作者
b253899 2022-10-27 23:53:12 Tom de Vries

[gdb/testsuite] Use remote_exec chmod instead of remote_spawn

I build gdb using -O2, and ran the testsuite using taskset -c 0, and ran into:
...
(gdb) PASS: gdb.server/connect-with-no-symbol-file.exp: sysroot=: \
action=delete: setup: adjust sysroot
builtin_spawn gdbserver --once localhost:2385 /connect-with-no-symbol-file^M
/bin/bash: connect-with-no-symbol-file: Permission denied^M
/bin/bash: line 0: exec: connect-with-no-symbol-file: cannot execute: \
Permission denied^M
During startup program exited with code 126.^M
Exiting^M
target remote localhost:2385^M
`connect-with-no-symbol-file' has disappeared; keeping its symbols.^M
localhost:2385: Connection timed out.^M
(gdb) FAIL: gdb.server/connect-with-no-symbol-file.exp: sysroot=: \
action=delete: connection to GDBserver succeeded
...

The expected series of events is (skipping disconnect and detach as I don't
think they're relevant to the problem):
- enter scenario "permission"
- cp $exec.bak $exec
- gdbserver start with $exec
- chmod 000 $exec
- connect to gdbserver
- enter scenario "delete"
- cp $exec.bak $exec
- gdbserver start with $exec
- delete $exec
- connect to gdbserver

The problem is that the chmod is executed using remote_spawn:
...
} elseif { $action == "permission" } {
remote_spawn target "chmod 000 $target_exec"
}
...
without waiting on the resulting spawn id, so we're not sure when the
chmod will have effect.

The FAIL we're seeing above is explained by the chmod having effect during the
delete scenario, after the "cp $exec.bak $exec" and before the "gdbserver
start with $exec".

Fix this by using remote_exec instead.

Likewise, fix a similar case in gdb.mi/mi-exec-run.exp.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29726

f52fb00 2022-10-27 17:45:43 Nelson Chu

RISC-V: Fix build failures for -Werror=sign-compare.

elfnn-riscv.c: In function ‘riscv_relax_resolve_delete_relocs’:
elfnn-riscv.c:4256:30: error: operand of ‘?:’ changes signedness from ‘int’ to ‘unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]

So make the operands unsigned could resolve problem.

bfd/
* elfnn-riscv.c (riscv_relax_resolve_delete_relocs): Fixed build
failures for -Werror=sign-compare.

ffbe895 2022-10-27 16:26:51 Alan Modra

Fuzzed files in archives

Given a fuzzed object file in an archive with section size exceeding
file size, objcopy will report an error like "section size (0xfeffffff
bytes) is larger than file size (0x17a bytes)" but will create a copy
of the object laid out for the large section. That means a large
temporary file on disk that is read back and written to the output
archive, which can take a while. The output archive is then deleted
due to the error. Avoid some of this silliness.

* objcopy.c (copy_section): If section contents cannot be read
set output section size to zero.

686657b 2022-10-27 16:24:37 Martin Liska

tests: use canonical option name

ld/ChangeLog:

* testsuite/ld-size/size.exp: Use canonical option name.

2c02c72 2022-10-27 10:22:05 Alan Modra

re: Support Intel AMX-FP16

Fix these fails due to the target padding out sections with nops.
x86_64-w64-mingw32 +FAIL: x86_64 AMX-FP16 insns
x86_64-w64-mingw32 +FAIL: x86_64 AMX-FP16 insns (Intel disassembly)

* testsuite/gas/i386/x86-64-amx-fp16-intel.d: Accept trailing nops.
* testsuite/gas/i386/x86-64-amx-fp16.d: Likewise.

1ad4041 2022-10-27 10:22:05 Alan Modra

Re: ld/testsuite: adjust ld-arm to run shared tests only when supported

commit 67527cffcd enabled previously disabled tests unresolved-1-dyn,
thumb-plt and thumb-plt-got for nacl. The first fails due to trying
to link against mixed-lib.so which isn't compiled for nacl. The last
two fail with
objdump: tmpdir/dump(.rel.plt): relocation 0 has invalid symbol index 14885104
and
readelf: Error: bad symbol index: 00e320f0 in reloc

Relocation section '.rel.plt' at offset 0x128 contains 1 entry:
Offset Info Type Sym. Value Symbol's Name
e320f000 e320f000 R_ARM_NONE

* testsuite/ld-arm/arm-elf.exp: Disable unresolved-1-dyn,
thumb-plt and thumb-plt-got for nacl.

ecb58b3 2022-10-27 09:00:09 GDB Administrator

Automatic date update in version.in

ee7f721 2022-10-27 00:23:40 Simon Marchi

gdb/testsuite: fix gdb.guile/scm-parameter.exp "wrong type argument" test pattern for Guile >= 2.2

Since commit 90319cefe3 ("GDB/Guile: Don't assert that an integer value
is boolean"), I see:

FAIL: gdb.guile/scm-parameter.exp: kind=PARAM_ZINTEGER: test-PARAM_ZINTEGER-param: guile (set-parameter-value! test-PARAM_ZINTEGER-param #:unlimited)
FAIL: gdb.guile/scm-parameter.exp: kind=PARAM_ZUINTEGER: test-PARAM_ZUINTEGER-param: guile (set-parameter-value! test-PARAM_ZUINTEGER-param #:unlimited)

This comes from the fact that GDB outputs this:

ERROR: In procedure set-parameter-value!:
In procedure gdbscm_set_parameter_value_x: Wrong type argument in position 2 (expecting integer): #:unlimited
Error while executing Scheme code.

while the test expects an additional "ERROR:" on the second line,
something like this:

ERROR: In procedure set-parameter-value!:
ERROR: In procedure gdbscm_set_parameter_value_x: Wrong type argument in position 2 (expecting integer): #:unlimited
Error while executing Scheme code.

Guile 2.0 outputs the `ERROR:` on the second line, while later versions
do not. Change the pattern to accept both outputs. This is similar to
commit 6bbe1a929c6 ("[gdb/testsuite] Fix gdb.guile/scm-breakpoint.exp
with guile 3.0").

Change-Id: I9dc45e7492a4f08340cad974610242ed689de959

23295de 2022-10-26 21:00:50 Luis Machado

gdb/arm: Fix M-profile EXC_RETURN

Arm v8-M Architecture Reference Manual,
D1.2.95 EXC_RETURN, Exception Return Payload
describes ES bit:

"ES, bit [0]
Exception Secure. The security domain the exception was taken to.
The possible values of this bit are:
0 Non-secure.
1 Secure"

arm-tdep.c:3443, arm_m_exception_cache () function tests this bit:

exception_domain_is_secure = (bit (lr, 0) == 0);

The test is negated!

Later on line 3553, the condition evaluates if an additional state
context is stacked:

/* With the Security extension, the hardware saves R4..R11 too. */
if (tdep->have_sec_ext && secure_stack_used
&& (!default_callee_register_stacking || exception_domain_is_secure))

RM, B3.19 Exception entry, context stacking
reads:
RPLHM "In a PE with the Security Extension, on taking an exception,
the PE hardware:
...
2. If exception entry requires a transition from Secure state to
Non-secure state, the PE hardware extends the stack frame and also
saves additional state context."

So we should test for !exception_domain_is_secure instead of non-negated
value!
These two bugs compensate each other so unstacking works correctly.

But another test of exception_domain_is_secure (negated due to the
first bug) prevents arm_unwind_secure_frames to work as expected:

/* Unwinding from non-secure to secure can trip security
measures. In order to avoid the debugger being
intrusive, rely on the user to configure the requested
mode. */
if (secure_stack_used && !exception_domain_is_secure
&& !arm_unwind_secure_frames)

Test with GNU gdb (GDB) 13.0.50.20221016-git.
Stopped in a non-secure handler:

(gdb) set arm unwind-secure-frames 0
(gdb) bt
#0 HAL_SYSTICK_Callback () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsmain.c:490
#1 0x0804081c in SysTick_Handler ()
at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsstm32l5xx_it.c:134
#2 <signal handler called>
#3 HAL_GPIO_ReadPin (GPIOx=0x52020800, GPIO_Pin=8192)
at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Drivers/STM32L5xx_HAL_Driver/Src/stm32l5xx_hal_gpio.c:386
#4 0x0c000338 in SECURE_Mode () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:86
#5 0x080403f2 in main () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsmain.c:278
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

The frames #3 and #4 are secure. backtrace should stop before #3.

Stopped in a secure handler:

(gdb) bt
#0 HAL_SYSTICK_Callback () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:425
#1 0x0c000b6a in SysTick_Handler ()
at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/stm32l5xx_it.c:234
warning: Non-secure to secure stack unwinding disabled.
#2 <signal handler called>

The exception from secure to secure erroneously stops unwinding. It should
continue as far as the security unlimited backtrace:

(gdb) set arm unwind-secure-frames 1
(gdb) si <-- used to rebuild frame cache after change of unwind-secure-frames
0x0c0008e6 425 if (SecureTimingDelay != 0U)
(gdb) bt
#0 0x0c0008e6 in HAL_SYSTICK_Callback () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:425
#1 0x0c000b6a in SysTick_Handler ()
at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/stm32l5xx_it.c:234
#2 <signal handler called>
#3 0x0c000328 in SECURE_Mode () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:88
#4 0x080403f2 in main () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsmain.c:278

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Set exception_domain_is_secure to the value expected by its name.
Fix exception_domain_is_secure usage in the additional state context
stacking condition.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>

b2e9e75 2022-10-26 21:00:17 Luis Machado

gdb/arm: fix IPSR field test in arm_m_exception_cache ()

Arm v8-M Architecture Reference Manual,
D1.2.141 IPSR, Interrupt Program Status Register reads
"Exception, bits [8:0]"

9 bits, not 8! It is uncommon but true!

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>

8b73ee2 2022-10-26 20:59:13 Luis Machado

gdb/arm: Terminate frame unwinding in M-profile lockup

In the lockup state the PC value of the the outer frame is irreversibly
lost. The other registers are intact so LR likely contains
PC of some frame next to the outer one, but we cannot analyze
the nearest outer frame without knowing its PC
therefore we do not know SP fixup for this frame.

The frame unwinder possibly gets mad due to the wrong SP value.
To prevent problems terminate unwinding if PC contains the magic
value of the lockup state.

Example session wihtout this change,
Cortex-M33 CPU in lockup, gdb 13.0.50.20221016-git:
----------------
(gdb) c
Continuing.

Program received signal SIGINT, Interrupt.
0xeffffffe in ?? ()
(gdb) bt
#0 0xeffffffe in ?? ()
#1 0x0c000a9c in HardFault_Handler ()
at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/stm32l5xx_it.c:99
#2 0x2002ffd8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
----------------
The frame #1 is at correct PC taken from LR, #2 is a total nonsense.

With the change:
----------------
(gdb) c
Continuing.

Program received signal SIGINT, Interrupt.
warning: ARM M in lockup state, stack unwinding terminated.
<signal handler called>
(gdb) bt
#0 <signal handler called>
(gdb)
----------------

There is a visible drawback of emitting a warning in a cache buildnig routine
as introduced in Torbjörn SVENSSON's
[PATCH v4] gdb/arm: Stop unwinding on error, but do not assert
The warning is printed just once and not repeated on each backtrace command.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>

99033a6 2022-10-26 17:56:40 Mike Frysinger

gdb: copyright: make file header scan a bit more pythonic

Should be functionally the same, but uses more pythonic idioms to get
fewer lines of code, and to make sure to not leak open file handles.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

e5fbca5 2022-10-26 17:54:50 Mike Frysinger

gdb: make copyright.py interface a bit nicer

This way people can run `./copyright.py --help` and get some info as
to what this does without it going and modifying the tree.

8f97b51 2022-10-26 17:53:44 Mike Frysinger

sim: testsuite: improve parallel test processing

The current logic limits itself to a maxdepth of 4 when looking for
results. This wouldn't be a problem if cris didn't have a testsuite
at a depth of 5 which we end up ignoring when summarizing. Rather
than bump the number from 4 to 5, rework the code so that we gather
the exact set of tests that we tried to run.

f84ffab 2022-10-26 16:26:38 Alan Modra

buffer overflow in _bfd_XX_print_ce_compressed_pdata

More fuzzed fun.

* peXXigen.c (_bfd_XX_print_ce_compressed_pdata): Use smaller of
virt_size and bfd section size as limit of function table.

5dcae8f 2022-10-26 15:57:45 Alan Modra

Correct ELF reloc size sanity check

The external reloc size check was wrong. Here asect is the code/data
section, not the reloc section. So using this_hdr gave the size of
the code/data section.

* elf.c (_bfd_elf_get_reloc_upper_bound): Properly get
external size from reloc headers.

4d664d5 2022-10-26 15:57:45 Alan Modra

segfault in objdump.c reloc_at

bfd_canonicalize_reloc returns -1L on errors.

* objdump.c (load_specific_debug_section): Properly handle
error return from bfd_canonicalize_reloc.

b8d97d3 2022-10-26 14:06:14 Alan Modra

som.c reloc sanity checking

This patch checks that relocations emitted in som_write_fixups have
offsets that are monotonic and within a section. To do that properly
using bfd_reloc_offset_in_range it is necessary to set the reloc howto
size field, which isn't used otherwise by the som backend. Note that
the sizes used are not exactly those in the old sizing switch
statement deleted from som_write_fixups, but all relocs handled by the
main switch statement there get the same size. Most unhandled relocs
get a zero size (exceptions being R_RELOCATION, R_SPACE_REF,
R_MILLI_REL, R_BREAKPOINT which all involve writing one word according
to my SOM reference). I figure it doesn't matter since any unhandled
reloc is converted to 0xff R_RESERVED, and a default of zero is better
for a "don't know" reloc.

Besides tidying the code, stringizing name from type in SOM_HOWTO
fixes R_REPEATED_INIT name.

* som.c (SOM_HOWTO): Add SIZE arg, delete NAME. Stringize type
to name.
(som_hppa_howto_table): Update with sizes.
(som_write_fixups): Delete sizing switch statement. Sanity check
bfd_reloc address against subsection size.

2f6ba62 2022-10-26 14:06:14 Alan Modra

som.c buffer overflow

Fuzzed object files can put random values in bfd_reloc->address,
leading to large som_reloc_skip output.

* som.c (som_write_fixups): Allow for maximal som_reloc_skip.

6175be4 2022-10-26 14:04:53 Alan Modra

PR29720, objdump -S crashes if build-id is missing

PR 29720
* objdump.c (slurp_file): Don't call debuginfod_find_source
when build_id is NULL.

9254cd1 2022-10-26 09:00:08 GDB Administrator

Automatic date update in version.in

9efe17a 2022-10-26 00:04:58 Simon Marchi

gdb: remove spurious spaces after frame_info_ptr

Fix some whitespace issues introduced with the frame_info_ptr patch.

Change-Id: I158d30d8108c97564276c647fc98283ff7b12163

a2267db 2022-10-25 23:41:26 Michael Matz

x86-64: Use only one default max-page-size

On x86-64 the default ELF_MAXPAGESIZE depends on a configure
option (--disable-separate-code). Since 9833b775
("PR28824, relro security issues") we use max-page-size for relro
alignment (with a short interval, from 31b4d3a ("PR28824, relro
security issues, x86 keep COMMONPAGESIZE relro") to its revert
a1faa5ea, where x86-64 only used COMMONPAGESIZE as relro alignment
target).

But that means that a linker configured with --disable-separate-code
behaves different from one configured with --enable-separate-code
(the default), _even if using "-z {no,}separate-code" option to use
the non-configured behaviour_ . In particular it means that when
configuring with --disable-separate-code the linker will produce
binaries aligned to 2MB pages on disk, and hence generate 2MB
executables for a hello world (and even 6MB when linked with
"-z separate-code").

Generally we can't have constants that ultimately land in static
variables be depending on configure options if those only influence
behaviour that is overridable by command line options.

So, do away with that, make the default MAXPAGESIZE be 4k (as is default
for most x86-64 configs anyway, as most people won't configure with
--disable-separate-code). If people need more they can use the
"-z max-page-size" (with would have been required right now for a
default configure binutils).

bfd/
* elf64-x86-64.c (ELF_MAXPAGESIZE): Don't depend on
DEFAULT_LD_Z_SEPARATE_CODE.

7699dfc 2022-10-25 23:36:23 Simon Marchi

gdb/testsuite: make sure to consume the prompt in gdb.base/unwind-on-each-insn.exp

This test fails quite reliably for me when ran as:

$ taskset -c 1 make check TESTS="gdb.base/unwind-on-each-insn.exp" RUNTESTFLAGS="--target_board=native-gdbserver"

or more simply:

$ make check-read1 TESTS="gdb.base/unwind-on-each-insn.exp"

The problem is that the gdb_test_multiple call that grabs the frame id
from "maint print frame-id" does not consume the prompt. Well, it does
sometimes due to the trailing .*, but not always. If the prompt is not
consumed, the tests that follow get confused:

FAIL: gdb.base/unwind-on-each-insn.exp: gdb_breakpoint: set breakpoint at *foo
FAIL: gdb.base/unwind-on-each-insn.exp: disassemble foo
FAIL: gdb.base/unwind-on-each-insn.exp: get $sp and frame base in foo: get hexadecimal valueof "$sp"
... many more ...

Use -wrap to make gdb_test_multiple consume the prompt.

While at it, remove the bit that consumes the command name and do
exp_continue, it's not really necessary. And for consistency, do the
same changes to the gdb_test_multiple that consumes the stack address,
although that one was fine, it did consume the prompt explicitly.

Change-Id: I2b7328c8844c7e98921ea494c4c05107162619fc
Reviewed-By: Bruno Larsen <blarsen@redhat.com>

0f2cd53 2022-10-25 21:14:34 Tom de Vries

[gdb/testsuite] Handle missing .note.GNU-stack

On openSUSE Tumbleweed I run into this for the dwarf assembly test-cases, and
some hardcoded assembly test-cases:
...
Running gdb.dwarf2/fission-absolute-dwo.exp ...
gdb compile failed, ld: warning: fission-absolute-dwo.o: \
missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future \
version of the linker

=== gdb Summary ===

# of untested testcases 1
...

Fix the dwarf assembly test-cases by adding the missing .note.GNU-stack in
proc Dwarf::assemble.

Fix the hard-coded test-cases using this command:
...
$ for f in $(find gdb/testsuite/gdb.* -name *.S); do
if ! grep -q note.GNU-stack $f; then
echo -e "\t.section\t.note.GNU-stack,\"\",@progbits" >> $f;
fi;
done
...

Likewise for .s files, and gdb/testsuite/lib/my-syscalls.S.

The idiom for arm seems to be to use %progbits instead, see commit 9a5911c08be
("gdb/testsuite/gdb.dwarf2: Replace @ with % for ARM compatability"), so
hand-edit gdb/testsuite/gdb.arch/arm-disp-step.S to use %progbits instead.

Note that dwarf assembly testcases use %progbits as decided by proc _section.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29674

4ff322b 2022-10-25 21:09:32 Tom de Vries

[gdb/testsuite] Add missing skip_gdbserver_tests in gdb.multi/attach-no-multi-process.exp

I build gdb without gdbserver, and ran into:
...
(gdb) PASS: gdb.multi/attach-no-multi-process.exp: target_non_stop=off: \
switch to inferior 2
spawn of --once --multi localhost:2346 failed
ERROR: tcl error sourcing attach-no-multi-process.exp.
ERROR: tcl error code NONE
ERROR: Timeout waiting for gdbserver response.
...

Add the missing skip_gdbserver_tests.

Tested on x86_64-linux.

47e2c30 2022-10-25 18:32:41 Tom de Vries

[gdb] Rewrite RETHROW_ON_TARGET_CLOSE_ERROR into function

Recent commit b2829fcf9b5 ("[gdb] Fix rethrow exception slicing in
insert_bp_location") introduced macro RETHROW_ON_TARGET_CLOSE_ERROR.

I wrote this as a macro in order to have the rethrowing throw be part of the
same function as the catch, but as it turns out that's not necessary.

Rewrite into a function.

Tested on x86_64-linux.

a5a0a4f 2022-10-25 13:12:38 Simon Marchi

gdb: internal_error -> internal_error_loc in gdb-gdb.gdb.in

Commit f34652de0b ("internal_error: remove need to pass
__FILE__/__LINE__") renamed the internal_error function to
internal_error_loc. Change gdb-gdb.gdb.in accordingly.

Change-Id: I876e1623607b6becf74ade53d102ead53a74ed86

845652b 2022-10-25 10:20:39 Nelson Chu

RISC-V: Should reset `again' flag for _bfd_riscv_relax_pc.

The R_RISCV_DELETE relocations are no longer deleted at another relax pass,
so we should reset 'again' flag to true for _bfd_riscv_relax_pc, while the
deleted bytes are marked as R_RISCV_DELETE.

bfd/
* elfnn-riscv.c (_bfd_riscv_relax_pc): Set `again' to true while the
deleted bytes are marked as R_RISCV_DELETE.

43025f0 2022-10-25 10:20:23 Patrick O'Neill

RISC-V: Improve link time complexity.

The riscv port does deletion and symbol table update for each relocation
while relaxing, so we are moving section bytes and scanning symbol table once
for each relocation. Compared to microblaze port, they record the relaxation
changes into a table, then do the deletion and symbol table update once per
section, rather than per relocation. Therefore, they should have better link
time complexity than us.

To improve the link time complexity, this patch try to make the deletion in
linear time. Compared to record the relaxation changes into a table, we
replace the unused relocation with R_RISCV_DELETE for the deleted bytes, and
then resolve them at the end of the section. Assuming the number of
R_RISCV_DELETE is m, and the number of symbols is n, the total link complexity
should be O(m) for moving section bytes, and O(m*n^2) for symbol table update.
If we record the relaxation changes into the table, and then sort the symbol
table by values, then probably can reduce the time complexity to O(m*n*log(n))
for updating symbol table, but it doesn't seem worth it for now.

bfd/
* elfnn-riscv.c (_riscv_relax_delete_bytes): Renamed from
riscv_relax_delete_bytes, updated to reduce the tiem complexity to O(m)
for memmove.
(typedef relax_delete_t): Function pointer declaration of delete functions.
(riscv_relax_delete_bytes): Can choose to use _riscv_relax_delete_piecewise
or _riscv_relax_delete_immediate for deletion.
(_riscv_relax_delete_piecewise): Just mark the deleted bytes as R_RISCV_DELETE.
(_riscv_relax_delete_immediate): Delete some bytes from a section while
relaxing.
(riscv_relax_resolve_delete_relocs): Delete the bytes for R_RISCV_DELETE
relocations from a section, at the end of _bfd_riscv_relax_section.
(_bfd_riscv_relax_call): Mark deleted bytes as R_RISCV_DELETE by reusing
R_RISCV_RELAX.
(_bfd_riscv_relax_lui): Likewise, but reuse R_RISCV_HI20 for lui, and reuse
R_RISCV_RELAX for c.lui.
(_bfd_riscv_relax_tls_le): Likewise, but resue R_RISCV_TPREL_HI20 and
R_RISCV_TPREL_ADD.
(_bfd_riscv_relax_pc): Likewise, but resue R_RISCV_PCREL_HI20 for auipc.
(_bfd_riscv_relax_align): Updated, don't need to resue relocation since
calling _riscv_relax_delete_immediate.
(_bfd_riscv_relax_delete): Removed.
(_bfd_riscv_relax_section): Set riscv_relax_delete_bytes for each relax_func,
to delete bytes immediately or later. Call riscv_relax_resolve_delete_relocs
to delete bytes for DELETE relocations from a section.