Age | Commit message (Collapse) | Author | Files | Lines |
|
This was only rudimentary support anyway; none of the sub-architecture
specific insns were ever supported.
|
|
Adjust x86-64 linker tests after reverting
commit 31b4d3a16f200bf04db8439a63b72bba7af4e1be
Author: Alan Modra <amodra@gmail.com>
Date: Thu Feb 3 08:57:47 2022 +1030
PR28824, relro security issues, x86 keep COMMONPAGESIZE relro
to use MAXPAGESIZE for the end of the relro segment alignment, like other
ELF targets.
* testsuite/ld-x86-64/plt-main-bnd.dd: Updated.
* testsuite/ld-x86-64/plt-main-ibt-x32.dd: Likewise.
* testsuite/ld-x86-64/plt-main-ibt.dd: Likewise.
* testsuite/ld-x86-64/pr14207.d: Likewise.
* testsuite/ld-x86-64/pr18176.d: Likewise.
* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
* testsuite/ld-x86-64/pr20830a.d: Likewise.
* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
* testsuite/ld-x86-64/pr20830b.d: Likewise.
* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
* testsuite/ld-x86-64/pr21038a.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038b.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
|
|
This reverts commit 31b4d3a16f200bf04db8439a63b72bba7af4e1be.
|
|
x86 treats MAXPAGESIZE as a memory optimisation parameter, actual
hardware paging is always COMMPAGESIZE of 4k. Use COMMONPAGESIZE for
the end of the relro segment alignment.
The previous patch regresses pr18176, increasing the testcase file
size from 322208 to 2099872 bytes. Fixing this on x86 will require
introducing a gap after the end of the relro segment (of up to
relropagesize-1 bytes).
PR 28824
PR 18176
* ld.h (ld_config_type): Add relro_use_commonpagesize field.
* ldexp.c (fold_segment_align): Set relropagesize depending on
relro_use_commonpagesize.
* emultempl/elf-x86.em (elf_x86_create_output_section_statements):
Set relro_use_commonpagesize.
* testsuite/ld-x86-64/pr18176.d: xfail.
|
|
I am checking this into master and will backport it to 2.38 branch.
H.J
----
On x86, GCC 12 supports -mno-direct-extern-access to enable canonical
reference to protected function and disable copy relocation. With
-mno-direct-extern-access, the canonical protected function symbols must
be accessed via canonical reference and the protected data symbols in
shared libraries are non-copyable. Under glibc 2.35, non-canonical
reference to the canonical protected function will get the run-time error:
./y: internal_f: ./libfoo.so: non-canonical reference to canonical protected function
and copy relocations against the non-copyable protected symbols will get
the run-time error:
./x: internal_i: ./libfoo.so: copy relocation against non-copyable protected symbol
Update x86 linker to disallow non-canonical reference to the canonical
protected function:
ld: plt.o: non-canonical reference to canonical protected function `internal_f' in libfoo.so
ld: failed to set dynamic section sizes: bad value
and copy relocation against the non-copyable protected symbol:
ld: main.o: copy relocation against non-copyable protected symbol `internal_i' in libfoo.so
at link-time.
bfd/
PR ld/28875
* elf-properties.c (_bfd_elf_parse_gnu_properties): Don't skip
shared libraries for GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
* elf32-i386.c (elf_i386_scan_relocs): Disallow non-canonical
reference to canonical protected function.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't allow copy
relocation against non-copyable protected symbol.
ld/
PR ld/28875
* testsuite/ld-i386/i386.exp: Check non-canonical reference to
canonical protected function and check copy relocation against
non-copyable protected symbol.
* testsuite/ld-i386/pr21997-1.err: New file.
* testsuite/ld-i386/pr28875.err: Likewise.
* testsuite/ld-i386/pr28875a.c: Likewise.
* testsuite/ld-i386/pr28875b.c: Likewise.
* testsuite/ld-x86-64/pr21997-1a.err: Updated.
* testsuite/ld-x86-64/pr21997-1b.err: Likewise.
* testsuite/ld-x86-64/pr28875-data.err: New file.
* testsuite/ld-x86-64/pr28875-func.err: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Check non-canonical reference
to canonical protected function and check copy relocation against
non-copyable protected symbol.
|
|
This reverts commit 2f83249c13d86065b4c7cdb198ea871017b4bba1.
PR ld/28743
* ldlang.c (lang_size_relro_segment_1): Revert 2022-01-10 changes.
* testsuite/ld-i386/pr20830.d: Likewise.
* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
* testsuite/ld-x86-64/pr14207.d: Likewise.
* testsuite/ld-x86-64/pr18176.d: Likewise.
* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
* testsuite/ld-x86-64/pr20830a.d: Likewise.
* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
* testsuite/ld-x86-64/pr20830b.d: Likewise.
* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
* testsuite/ld-x86-64/pr21038a.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
|
|
This reverts commit c804c6f98d342c3d46f73d7a7ec6229d5ab1c9f3.
PR ld/28743
PR ld/28819
* ldlang.c (lang_size_relro_segment_1): Revert 2022-01-14 change.
* testsuite/ld-x86-64/pr28743-1.d: Likewise.
* testsuite/ld-x86-64/pr28743-1.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
|
|
1. Compute the desired PT_GNU_RELRO segment base and find the maximum
section alignment of sections starting from the PT_GNU_RELRO segment.
2. Find the first preceding load section.
3. Don't add the 1-page gap between the first preceding load section and
the relro segment if the maximum page size >= the maximum section
alignment. Align the PT_GNU_RELRO segment first. Subtract the maximum
page size if therer is still a 1-page gap.
PR ld/28743
PR ld/28819
* ldlang.c (lang_size_relro_segment_1): Rewrite.
* testsuite/ld-x86-64/pr28743-1.d: New file.
* testsuite/ld-x86-64/pr28743-1.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr28743-1.
|
|
Disable DT_RELR in the following -z relro tests which don't expect
DT_RELR in linker outputs.
* testsuite/ld-i386/pr20830.d: Pass $NO_DT_RELR_LDFLAGS to ld.
* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
* testsuite/ld-x86-64/pr20830a.d: Likewise.
* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
* testsuite/ld-x86-64/pr20830b.d: Likewise.
* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
* testsuite/ld-x86-64/pr21038a.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
|
|
The existing RELRO scheme may leave a 1-page gap before the RELRO segment
and align the end of the RELRO segment to the page size:
[18] .eh_frame PROGBITS 408fa0 008fa0 005e80 00 A 0 0 8
[19] .init_array INIT_ARRAY 410de0 00fde0 000008 08 WA 0 0 8
[20] .fini_array FINI_ARRAY 410de8 00fde8 000008 08 WA 0 0 8
[21] .dynamic DYNAMIC 410df0 00fdf0 000200 10 WA 7 0 8
[22] .got PROGBITS 410ff0 00fff0 000010 08 WA 0 0 8
[23] .got.plt PROGBITS 411000 010000 000048 08 WA 0 0 8
Instead, we can remove the 1-page gap if the maximum page size >= the
maximum section alignment:
[18] .eh_frame PROGBITS 408fa0 008fa0 005e80 00 A 0 0 8
[19] .init_array INIT_ARRAY 40fde0 00fde0 000008 08 WA 0 0 8
[20] .fini_array FINI_ARRAY 40fde8 00fde8 000008 08 WA 0 0 8
[21] .dynamic DYNAMIC 40fdf0 00fdf0 000200 10 WA 7 0 8
[22] .got PROGBITS 40fff0 00fff0 000010 08 WA 0 0 8
[23] .got.plt PROGBITS 410000 010000 000048 08 WA 0 0 8
Because the end of the RELRO segment is always aligned to the page size
and may not be moved, the RELRO segment size may be increased:
[ 3] .dynstr STRTAB 000148 000148 000001 00 A 0 0 1
[ 4] .eh_frame PROGBITS 000150 000150 000000 00 A 0 0 8
[ 5] .init_array INIT_ARRAY 200150 000150 000010 08 WA 0 0 1
[ 6] .fini_array FINI_ARRAY 200160 000160 000010 08 WA 0 0 1
[ 7] .jcr PROGBITS 200170 000170 000008 00 WA 0 0 1
[ 8] .data.rel.ro PROGBITS 200180 000180 000020 00 WA 0 0 16
[ 9] .dynamic DYNAMIC 2001a0 0001a0 0001c0 10 WA 3 0 8
[10] .got PROGBITS 200360 000360 0002a8 00 WA 0 0 8
[11] .bss NOBITS 201000 000608 000840 00 WA 0 0 1
vs the old section layout:
[ 3] .dynstr STRTAB 000148 000148 000001 00 A 0 0 1
[ 4] .eh_frame PROGBITS 000150 000150 000000 00 A 0 0 8
[ 5] .init_array INIT_ARRAY 200b48 000b48 000010 08 WA 0 0 1
[ 6] .fini_array FINI_ARRAY 200b58 000b58 000010 08 WA 0 0 1
[ 7] .jcr PROGBITS 200b68 000b68 000008 00 WA 0 0 1
[ 8] .data.rel.ro PROGBITS 200b70 000b70 000020 00 WA 0 0 16
[ 9] .dynamic DYNAMIC 200b90 000b90 0001c0 10 WA 3 0 8
[10] .got PROGBITS 200d50 000d50 0002a8 00 WA 0 0 8
[11] .bss NOBITS 201000 000ff8 000840 00 WA 0 0 1
But there is no 1-page gap.
PR ld/28743
* ldlang.c (lang_size_relro_segment_1): Remove the 1-page gap
before the RELRO segment if the maximum page size >= the maximum
section alignment.
* testsuite/ld-i386/pr20830.d: Adjusted.
* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
* testsuite/ld-x86-64/pr14207.d: Likewise.
* testsuite/ld-x86-64/pr18176.d: Likewise.
* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
* testsuite/ld-x86-64/pr20830a.d: Likewise.
* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
* testsuite/ld-x86-64/pr20830b.d: Likewise.
* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
* testsuite/ld-x86-64/pr21038a.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
|
|
* testsuite/ld-elf/dt-relr-1.s: New file.
* testsuite/ld-elf/dt-relr-1a.d: Likewise.
* testsuite/ld-elf/dt-relr-1b.d: Likewise.
* testsuite/ld-elf/dt-relr-1c.d: Likewise.
* testsuite/ld-elf/dt-relr-2.s: Likewise.
* testsuite/ld-elf/dt-relr-2a.d: Likewise.
* testsuite/ld-elf/dt-relr-2b.d: Likewise.
* testsuite/ld-elf/dt-relr-2c.d: Likewise.
* testsuite/ld-elf/dt-relr-2d.d: Likewise.
* testsuite/ld-elf/dt-relr-2e.d: Likewise.
* testsuite/ld-elf/dt-relr-2f.d: Likewise.
* testsuite/ld-elf/dt-relr-2g.d: Likewise.
* testsuite/ld-elf/dt-relr-2h.d: Likewise.
* testsuite/ld-elf/dt-relr-3.s: Likewise.
* testsuite/ld-elf/dt-relr-3a.d: Likewise.
* testsuite/ld-elf/dt-relr-3b.d: Likewise.
* testsuite/ld-i386/dt-relr-1.s: Likewise.
* testsuite/ld-i386/dt-relr-1a.d: Likewise.
* testsuite/ld-i386/dt-relr-1b.d: Likewise.
* testsuite/ld-x86-64/dt-relr-1a-x32.d: Likewise.
* testsuite/ld-x86-64/dt-relr-1a.d: Likewise.
* testsuite/ld-x86-64/dt-relr-1b-x32.d: Likewise.
* testsuite/ld-x86-64/dt-relr-1b.d: Likewise.
* testsuite/ld-x86-64/dt-relr-1.s: Likewise.
* testsuite/ld-i386/i386.exp: Run dt-relr-1a and dt-relr-1b.
* testsuite/ld-x86-64/x86-64.exp: Run dt-relr-1a, dt-relr-1a-x32
dt-relr-1b and dt-relr-1b-x32.
|
|
Allow eabling and disabling DT_RELR in linker tests. Disable DT_RELR in
linker tests which don't expect DT_RELR in linker outputs.
binutils/
* testsuite/lib/binutils-common.exp (run_dump_test): Make
DT_RELR_LDFLAGS and NO_DT_RELR_LDFLAGS global.
ld/
* testsuite/config/default.exp (DT_RELR_LDFLAGS): New.
(DT_RELR_CC_LDFLAGS): Likewise.
(NO_DT_RELR_LDFLAGS): Likewise.
(NO_DT_RELR_CC_LDFLAGS): Likewise.
* testsuite/ld-elf/shared.exp: Pass $NO_DT_RELR_LDFLAGS to
linker for some tests.
* testsuite/ld-i386/export-class.exp: Likewise.
* testsuite/ld-i386/i386.exp: Likewise.
* testsuite/ld-i386/ibt-plt-2a.d: Pass $NO_DT_RELR_LDFLAGS to
linker.
* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
* testsuite/ld-i386/pr26869.d: Likewise.
* testsuite/ld-i386/report-reloc-1.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
* testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
* testsuite/ld-x86-64/ilp32-4.d: Likewise.
* testsuite/ld-x86-64/load1c.d: Likewise.
* testsuite/ld-x86-64/load1d.d: Likewise.
* testsuite/ld-x86-64/pr13082-2b.d: Likewise.
* testsuite/ld-x86-64/pr14207.d: Likewise.
* testsuite/ld-x86-64/pr18176.d: Likewise.
* testsuite/ld-x86-64/pr19162.d: Likewise.
* testsuite/ld-x86-64/pr19636-2d.d: Likewise.
* testsuite/ld-x86-64/pr19636-2l.d: Likewise.
* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
* testsuite/ld-x86-64/pr20253-1f.d: Likewise.
* testsuite/ld-x86-64/pr20253-1j.d: Likewise.
* testsuite/ld-x86-64/pr20253-1l.d: Likewise.
* testsuite/ld-x86-64/report-reloc-1-x32.d: Likewise.
* testsuite/ld-x86-64/report-reloc-1.d: Likewise.
* testsuite/ld-x86-64/export-class.exp (x86_64_export_class_test):
Pass $NO_DT_RELR_LDFLAGS to linker.
* testsuite/ld-x86-64/x86-64.exp: Pass $NO_DT_RELR_LDFLAGS to
linker for some tests.
|
|
DT_RELR encodes consecutive R_*_RELATIVE relocations in GOT (the global
offset table) and data sections in a compact format:
https://groups.google.com/g/generic-abi/c/bX460iggiKg
On some targets, R_*_RELATIVE relocations are counted and the GOT offsets
are allocated when setting the dynamic section sizes after seeing all
relocations. R_*_RELATIVE relocations are generated while relocating
sections after section layout has been finalized.
To prepare for DT_RELR implementation on these targets, extract
_bfd_elf_link_iterate_on_relocs from _bfd_elf_link_check_relocs so
that a backend can scan relocations in elf_backend_always_size_sections
For x86 targets, the old check_relocs is renamed to scan_relocs and a
new check_relocs is added to chek input sections and create dynamic
relocation sections so that they will be mapped to output sections.
scan_relocs is now called from elf_backend_always_size_sections.
Since relocations are scanned after __start, __stop, .startof. and
.sizeof. symbols have been finalized on x86, __[start|stop]_SECNAME for
--gc-sections -z start-stop-gc are now zero when all SECNAME sections
been garbage collected. This is no need for elf_x86_start_stop_gc_p.
bfd/
* elf-bfd.h (_bfd_elf_link_iterate_on_relocs): New.
* elf32-i386.c (elf_i386_convert_load_reloc): Don't call
elf_x86_start_stop_gc_p.
(elf_i386_check_relocs): Renamed to ...
(elf_i386_scan_relocs): This. Don't call
_bfd_elf_make_dynamic_reloc_section.
(elf_i386_always_size_sections): New.
(elf_backend_check_relocs): Removed.
(elf_backend_always_size_sections): New.
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't call
elf_x86_start_stop_gc_p.
(elf_x86_64_check_relocs): Renamed to ...
(elf_x86_64_scan_relocs): This. Don't call
_bfd_elf_make_dynamic_reloc_section.
(elf_x86_64_always_size_sections): New.
(elf_backend_check_relocs): Removed.
(elf_backend_always_size_sections): New.
* elflink.c (elf_link_check_or_scan_relocs):
New. Extracted from _bfd_elf_link_check_relocs.
(_bfd_elf_link_check_relocs): Call elf_link_check_or_scan_relocs.
* elfxx-x86.c (_bfd_x86_elf_check_relocs): New.
* elfxx-x86.h (X86_64_NEED_DYNAMIC_RELOC_TYPE_P): New.
(I386_NEED_DYNAMIC_RELOC_TYPE_P): Likewise.
(X86_NEED_DYNAMIC_RELOC_TYPE_P): Likewise.
(_bfd_x86_elf_check_relocs): Likewise.
(elf_backend_check_relocs): Likewise.
(elf_backend_always_size_sections): Removed.
(elf_x86_start_stop_gc_p): Likewise.
ld/
* testsuite/ld-i386/pr27491-1a.d: Updated.
* testsuite/ld-x86-64/pr27491-1a.d: Likewise.
|
|
Use 0x%v, instead of bfd_sprintf_vma, to report relative relocations.
Change linker relative relocations report from
tmpdir/dump: R_X86_64_IRELATIVE (offset: 0x0000000000002000, info: 0x0000000000000025, addend: 0x0000000000001007) against 'ifunc' for section '.data.rel.ro.local' in tmpdir/report-reloc-1.o
to
tmpdir/dump: R_X86_64_IRELATIVE (offset: 0x2000, info: 0x25, addend: 0x1007) against 'ifunc' for section '.data.rel.ro.local' in tmpdir/report-reloc-1.o
bfd/
* elfxx-x86.c (_bfd_x86_elf_link_report_relative_reloc): Use
0x%v instead of bfd_sprintf_vma.
ld/
* testsuite/ld-i386/report-reloc-1.l: Updated.
* testsuite/ld-x86-64/report-reloc-1.l: Likewise.
|
|
The result of running etc/update-copyright.py --this-year, fixing all
the files whose mode is changed by the script, plus a build with
--enable-maintainer-mode --enable-cgen-maint=yes, then checking
out */po/*.pot which we don't update frequently.
The copy of cgen was with commit d1dd5fcc38ead reverted as that commit
breaks building of bfp opcodes files.
|
|
* testsuite/ld-x86-64/x86-64.exp: Pass options to linker with
"-Wl,".
|
|
Adjust linker tests for linker configured with --disable-separate-code:
1. Update expected outputs.
2. Pass -z max-page-size=0x1000 -z separate-code" to linker.
* testsuite/ld-i386/report-reloc-1.l: Updated.
* testsuite/ld-x86-64/report-reloc-1.l: Likewise.
* testsuite/ld-x86-64/pe-x86-64.exp: Pass
"-z max-page-size=0x1000 -z separate-code" to linker.
* testsuite/ld-x86-64/pr19609-4e.d: Likewise.
* testsuite/ld-x86-64/pr19609-6a.d: Likewise.
* testsuite/ld-x86-64/pr19609-6b.d: Likewise.
* testsuite/ld-x86-64/pr19609-7b.d: Likewise.
* testsuite/ld-x86-64/pr19609-7d.d: Likewise.
|
|
Don't convert memory load to immediate load on __start_SECNAME and
__stop_SECNAME for --gc-sections -z start-stop-gc if all SECNAME
sections been garbage collected.
bfd/
PR ld/27491
* elf32-i386.c (elf_i386_convert_load_reloc): Skip __start_SECNAME
and __stop_SECNAME for --gc-sections -z start-stop-gc if the input
section been garbage collected.
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
* elfxx-x86.h (elf_x86_start_stop_gc_p): New function.
ld/
PR ld/27491
* testsuite/ld-i386/i386.exp: Run PR ld/27491 tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr27491-1.s: New file.
* testsuite/ld-i386/pr27491-1a.d: Likewise.
* testsuite/ld-i386/pr27491-1b.d: Likewise.
* testsuite/ld-i386/pr27491-1c.d: Likewise.
* testsuite/ld-i386/pr27491-2.d: Likewise.
* testsuite/ld-i386/pr27491-2.s: Likewise.
* testsuite/ld-i386/pr27491-3.d: Likewise.
* testsuite/ld-i386/pr27491-3.s: Likewise.
* testsuite/ld-i386/pr27491-4.d: Likewise.
* testsuite/ld-i386/pr27491-4a.s: Likewise.
* testsuite/ld-i386/pr27491-4b.s: Likewise.
* testsuite/ld-x86-64/pr27491-1.s: Likewise.
* testsuite/ld-x86-64/pr27491-1a.d: Likewise.
* testsuite/ld-x86-64/pr27491-1b.d: Likewise.
* testsuite/ld-x86-64/pr27491-1c.d: Likewise.
* testsuite/ld-x86-64/pr27491-2.d: Likewise.
* testsuite/ld-x86-64/pr27491-2.s: Likewise.
* testsuite/ld-x86-64/pr27491-3.d: Likewise.
* testsuite/ld-x86-64/pr27491-3.s: Likewise.
* testsuite/ld-x86-64/pr27491-4.d: Likewise.
* testsuite/ld-x86-64/pr27491-4a.s: Likewise.
* testsuite/ld-x86-64/pr27491-4b.s: Likewise.
|
|
that shared libraries default to an entry point of 0.
* ldlang.c (lang_end): When computing the entry point, only
try the start address of the entry section when creating an
executable.
* ld.texi (Entry point): Update description of heuristic used to
choose the entry point.
testsuite/ld-alpha/tlspic.rd: Update expected entry point address.
testsuite/ld-arm/tls-gdesc-got.d: Likewise.
testsuite/ld-i386/tlsnopic.rd: Likewise.
testsuite/ld-ia64/tlspic.rd: Likewise.
testsuite/ld-sparc/gotop32.rd: Likewise.
testsuite/ld-sparc/gotop64.rd: Likewise.
testsuite/ld-sparc/tlssunnopic32.rd: Likewise.
testsuite/ld-sparc/tlssunnopic64.rd: Likewise.
testsuite/ld-sparc/tlssunpic32.rd: Likewise.
testsuite/ld-sparc/tlssunpic64.rd: Likewise.
testsuite/ld-tic6x/shlib-1.rd: Likewise.
testsuite/ld-tic6x/shlib-1b.rd: Likewise.
testsuite/ld-tic6x/shlib-1r.rd: Likewise.
testsuite/ld-tic6x/shlib-1rb.rd: Likewise.
testsuite/ld-tic6x/shlib-noindex.rd: Likewise.
testsuite/ld-x86-64/pr14207.d: Likewise.
testsuite/ld-x86-64/tlsdesc.rd: Likewise.
testsuite/ld-x86-64/tlspic.rd: Likewise.
testsuite/ld-x86-64/tlspic2.rd: Likewise.
|
|
The top level Makefile, the ld Makefile and others, define
CC_FOR_TARGET to be a compiler for the binutils target machine. This
is the compiler that should be used for almost all tests with C
source. There are _FOR_TARGET versions of CFLAGS, CXX, and CXXFLAGS
too. This was all supposed to work with the testsuite .exp files
using CC for the target compiler, and CC_FOR_HOST for the host
compiler, with the makefiles passing CC=$CC_FOR_TARGET and
CC_FOR_HOST=$CC to the runtest invocation.
One exception to the rule of using CC_FOR_TARGET is the native-only ld
bootstrap test, which uses the newly built ld to link a copy of
itself. Since the files being linked were created with the host
compiler, the boostrap test should use CC and CFLAGS, in case some
host compiler option provides needed libraries automatically.
However, bootstrap.exp used CC where it should have used CC_FOR_HOST.
I set about fixing that problem, then decided that playing games in
the makefiles with CC was a bad idea. Not only is it confusing, but
other dejagnu code knows about CC_FOR_TARGET. See dejagnu/target.exp.
So this patch gets rid of the makefile variable renaming and changes
all the .exp files to use the correct _FOR_TARGET variables.
CC_FOR_HOST and CFLAGS_FOR_HOST disappear. A followup patch will
correct bootstrap.exp to use CFLAGS, and a number of other things I
noticed.
binutils/
* testsuite/lib/binutils-common.exp (run_dump_test): Use
CC_FOR_TARGET and CFLAGS_FOR_TARGET rather than CC and CFLAGS.
ld/
* Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET
and similar. Pass variables with unchanged names. Don't set
CC_FOR_HOST or CFLAGS_FOR_HOST.
* Makefile.in: Regenerate.
* testsuite/config/default.exp: Update default CC and similar.
(compiler_supports, plug_opt): Use CC_FOR_TARGET.
* testsuite/ld-cdtest/cdtest.exp: Replace all uses of CC with
CC_FOR_TARGET, and similarly for CFLAGS, CXX and CXXFLAGS.
* testsuite/ld-auto-import/auto-import.exp: Likewise.
* testsuite/ld-cygwin/exe-export.exp: Likewise.
* testsuite/ld-elf/dwarf.exp: Likewise.
* testsuite/ld-elf/indirect.exp: Likewise.
* testsuite/ld-elf/shared.exp: Likewise.
* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
* testsuite/ld-elfvers/vers.exp: Likewise.
* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
* testsuite/ld-elfweak/elfweak.exp: Likewise.
* testsuite/ld-gc/gc.exp: Likewise.
* testsuite/ld-ifunc/ifunc.exp: Likewise.
* testsuite/ld-mn10300/mn10300.exp: Likewise.
* testsuite/ld-pe/pe-compile.exp: Likewise.
* testsuite/ld-pe/pe-run.exp: Likewise.
* testsuite/ld-pe/pe-run2.exp: Likewise.
* testsuite/ld-pie/pie.exp: Likewise.
* testsuite/ld-plugin/lto.exp: Likewise.
* testsuite/ld-plugin/plugin.exp: Likewise.
* testsuite/ld-scripts/crossref.exp: Likewise.
* testsuite/ld-selective/selective.exp: Likewise.
* testsuite/ld-sh/sh.exp: Likewise.
* testsuite/ld-shared/shared.exp: Likewise.
* testsuite/ld-srec/srec.exp: Likewise.
* testsuite/ld-undefined/undefined.exp: Likewise.
* testsuite/ld-unique/unique.exp: Likewise.
* testsuite/ld-x86-64/tls.exp: Likewise.
* testsuite/lib/ld-lib.exp: Likewise.
libctf/
* Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET.
Pass CC and CC_FOR_TARGET. Don't set CC_FOR_HOST.
* Makefile.in: Regenerate.
* testsuite/config/default.exp: Update default CC and similar.
* testsuite/lib/ctf-lib.exp (run_native_host_cmd): Use CC rather
than CC_FOR_HOST.
(run_lookup_test): Use CC_FOR_TARGET and CFLAGS_FOR_TARGET.
|
|
ld/
* testsuite/ld-x86-64/x86-64.exp (Build textrel-1): Use --warn-textrel.
|
|
If GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS is set on any input
relocatable files:
1. Don't generate copy relocations.
2. Turn off extern_protected_data since it implies
GNU_PROPERTY_NO_COPY_ON_PROTECTED.
3. Treate reference to protected symbols with indirect external access
as local.
4. Set GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS on output.
5. When generating executable, clear this bit when there are non-GOT or
non-PLT relocations in input relocatable files without the bit set.
6. Add -z [no]indirect-extern-access to control indirect external access.
bfd/
* elf-bfd (elf_obj_tdata): Add has_indirect_extern_access.
(elf_has_indirect_extern_access): New.
* elf-properties.c (_bfd_elf_parse_gnu_properties): Set
elf_has_indirect_extern_access and elf_has_no_copy_on_protected
when seeing GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
(elf_write_gnu_propertie): Add an argument to pass link_info.
Set needed_1_p for GNU_PROPERTY_1_NEEDED in memory.
(_bfd_elf_link_setup_gnu_properties): Handle
GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS for
-z indirect-extern-access. Set nocopyreloc to true and
extern_protected_data to false for indirect external access.
(_bfd_elf_convert_gnu_properties): Updated.
* elf32-i386.c (elf_i386_check_relocs): Set
non_got_ref_without_indirect_extern_access on legacy non-GOT or
non-PLT references.
* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
* elflink.c (_bfd_elf_symbol_refs_local_p): Return true for
STV_PROTECTED symbols with indirect external access.
* elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Clear
indirect_extern_access for legacy non-GOT/non-PLT references.
* elfxx-x86.h (elf_x86_link_hash_entry): Add
non_got_ref_without_indirect_extern_access.
include/
* bfdlink.h (bfd_link_info): Add indirect_extern_access and
needed_1_p. Change nocopyreloc to int.
ld/
* NEWS: Mention -z [no]indirect-extern-access
* ld.texi: Document -z [no]indirect-extern-access
* ldmain.c (main): Initialize link_info.indirect_extern_access
to -1.
* emulparams/extern_protected_data.sh: Support
-z [no]indirect-extern-access.
* testsuite/ld-elf/indirect-extern-access-1.rd: New file
* testsuite/ld-elf/indirect-extern-access-1a.c: Likewise.
* testsuite/ld-elf/indirect-extern-access-1b.c: Likewise.
* testsuite/ld-elf/indirect-extern-access-2.rd: Likewise.
* testsuite/ld-elf/indirect-extern-access-2a.c: Likewise.
* testsuite/ld-elf/indirect-extern-access-2b.c: Likewise.
* testsuite/ld-elf/indirect-extern-access-3.rd: Likewise.
* testsuite/ld-elf/indirect-extern-access.S: Likewise.
* testsuite/ld-elf/property-1_needed-1b.d: Likewise.
* testsuite/ld-elf/property-1_needed-1c.d: Likewise.
* testsuite/ld-x86-64/indirect-extern-access.rd: Likewise.
* testsuite/ld-x86-64/protected-data-1.h: Likewise.
* testsuite/ld-x86-64/protected-data-1a.c: Likewise.
* testsuite/ld-x86-64/protected-data-1b.c: Likewise.
* testsuite/ld-x86-64/protected-data-2a.S: Likewise.
* testsuite/ld-x86-64/protected-data-2b.S: Likewise.
* testsuite/ld-x86-64/protected-func-2a.S: Likewise.
* testsuite/ld-x86-64/protected-func-2b.S: Likewise.
* testsuite/ld-x86-64/protected-func-2c.c: Likewise.
* testsuite/ld-elf/linux-x86.exp: Run test with
GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
* testsuite/ld-x86-64/x86-64.exp: Run tests for protected
function and data with indirect external access.
|
|
Disallow PC relocations against weak undefined symbols in PIE since they
can lead to non-zero address at run-time.
bfd/
PR ld/21782
* elf64-x86-64.c (elf_x86_64_relocate_section): Disallow PC
relocations against weak undefined symbols in PIE.
ld/
PR ld/21782
* testsuite/ld-x86-64/pie3.d: Expect linker error.
|
|
Change
ld: warning: creating DT_TEXTREL in a PIE
to
ld: warning: creating DT_TEXTREL in a PDE
on PDE.
bfd/
* elflink.c (bfd_elf_final_link): Correct DT_TEXTREL warning in
PDE.
ld/
* testsuite/ld-x86-64/textrel-1.err: New file.
* testsuite/ld-x86-64/textrel-1a.s: Likewise.
* testsuite/ld-x86-64/textrel-1b.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run textrel-1 tests.
|
|
PR ld/27973
* testsuite/ld-x86-64/x86-64.exp: Pass $NOPIE_LDFLAGS and
$NOPIE_CFLAGS to protected-func-1 without PIE.
|
|
On x86-64, function pointers in executable for external funtions may be
resolved to their PLT entries in executable. If it happens, function
pointers of protected funtions in shared libraries must be resolved to
the PLT entries in executable, not addresses of protected funtions in
shared libraries.
PR ld/27973
* testsuite/ld-x86-64/x86-64.exp: Run protected function tests.
* testsuite/ld-x86-64/protected-func-1.h: New file.
* testsuite/ld-x86-64/protected-func-1a.s: Likewise.
* testsuite/ld-x86-64/protected-func-1b.c: Likewise.
|
|
The x86-64 psABI has
---
A program or object file using R_X86_64_8, R_X86_64_16, R_X86_64_PC16
or R_X86_64_PC8 relocations is not conformant to this ABI, these
relocations are only added for documentation purposes.
---
Since x86 PC16 relocations have been used for 16-bit programs in an ELF32
or ELF64 container, PC16 relocation should wrap-around in 16-bit address
space. Revert
commit a7664973b24a242cd9ea17deb5eaf503065fc0bd
Author: Jan Beulich <jbeulich@suse.com>
Date: Mon Apr 26 10:41:35 2021 +0200
x86: correct overflow checking for 16-bit PC-relative relocs
and xfail the related tests. Also revert
commit 50c95a739c91ae70cf8481936611aa1f5397a384
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed May 26 12:13:13 2021 -0700
x86: Propery check PC16 reloc overflow in 16-bit mode instructions
while keeping PR ld/27905 tests for PC16 relocation in 16-bit programs.
bfd/
PR ld/27905
* elf32-i386.c: Don't include "libiberty.h".
(elf_howto_table): Revert commits a7664973b24 and 50c95a739c9.
(elf_i386_rtype_to_howto): Revert commit 50c95a739c9.
(elf_i386_info_to_howto_rel): Likewise.
(elf_i386_tls_transition): Likewise.
(elf_i386_relocate_section): Likewise.
* elf64-x86-64.c (x86_64_elf_howto_table): Revert commits
a7664973b24 and 50c95a739c9.
(elf_x86_64_rtype_to_howto): Revert commit 50c95a739c9.
* elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Likewise.
* elfxx-x86.h (elf_x86_obj_tdata): Likewise.
(elf_x86_has_code16): Likewise.
binutils/
PR ld/27905
* readelf.c (decode_x86_feature_2): Revert commit 50c95a739c9.
gas/
PR ld/27905
* config/tc-i386.c (set_code_flag): Revert commit 50c95a739c9.
(set_16bit_gcc_code_flag): Likewise.
(x86_cleanup): Likewise.
* testsuite/gas/i386/code16-2.d: Updated.
* testsuite/gas/i386/x86-64-code16-2.d: Likewise.
include/
PR ld/27905
* elf/common.h (GNU_PROPERTY_X86_FEATURE_2_CODE16): Removed.
ld/
PR ld/27905
* testsuite/ld-i386/pcrel16-2.d: xfail.
* testsuite/ld-x86-64/pcrel16-2.d: Likewise.
|
|
commit a7664973b24a242cd9ea17deb5eaf503065fc0bd
Author: Jan Beulich <jbeulich@suse.com>
Date: Mon Apr 26 10:41:35 2021 +0200
x86: correct overflow checking for 16-bit PC-relative relocs
caused linker failure when building 16-bit program in a 32-bit ELF
container. Update GNU_PROPERTY_X86_FEATURE_2_USED with
#define GNU_PROPERTY_X86_FEATURE_2_CODE16 (1U << 12)
to indicate that 16-bit mode instructions are used in the input object:
https://groups.google.com/g/x86-64-abi/c/UvvXWeHIGMA
to indicate that 16-bit mode instructions are used in the object to
allow linker to properly perform relocation overflow check for 16-bit
PC-relative relocations in 16-bit mode instructions.
1. Update x86 assembler to always generate the GNU property note with
GNU_PROPERTY_X86_FEATURE_2_CODE16 for .code16 in ELF object.
2. Update i386 and x86-64 linkers to use 16-bit PC16 relocations if
input object is marked with GNU_PROPERTY_X86_FEATURE_2_CODE16.
bfd/
PR ld/27905
* elf32-i386.c: Include "libiberty.h".
(elf_howto_table): Add 16-bit R_386_PC16 entry.
(elf_i386_rtype_to_howto): Add a BFD argument. Use 16-bit
R_386_PC16 if input has 16-bit mode instructions.
(elf_i386_info_to_howto_rel): Update elf_i386_rtype_to_howto
call.
(elf_i386_tls_transition): Likewise.
(elf_i386_relocate_section): Likewise.
* elf64-x86-64.c (x86_64_elf_howto_table): Add 16-bit
R_X86_64_PC16 entry.
(elf_x86_64_rtype_to_howto): Use 16-bit R_X86_64_PC16 if input
has 16-bit mode instructions.
* elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Set
elf_x86_has_code16 if relocatable input is marked with
GNU_PROPERTY_X86_FEATURE_2_CODE16.
* elfxx-x86.h (elf_x86_obj_tdata): Add has_code16.
(elf_x86_has_code16): New.
binutils/
PR ld/27905
* readelf.c (decode_x86_feature_2): Support
GNU_PROPERTY_X86_FEATURE_2_CODE16.
gas/
PR ld/27905
* config/tc-i386.c (set_code_flag): Update x86_feature_2_used
with GNU_PROPERTY_X86_FEATURE_2_CODE16 for .code16 in ELF
object.
(set_16bit_gcc_code_flag): Likewise.
(x86_cleanup): Always generate the GNU property note if
x86_feature_2_used isn't 0.
* testsuite/gas/i386/code16-2.d: New file.
* testsuite/gas/i386/code16-2.s: Likewise.
* testsuite/gas/i386/x86-64-code16-2.d: Likewise.
* testsuite/gas/i386/i386.exp: Run code16-2 and x86-64-code16-2.
include/
PR ld/27905
* elf/common.h (GNU_PROPERTY_X86_FEATURE_2_CODE16): New.
ld/
PR ld/27905
* testsuite/ld-i386/code16.d: New file.
* testsuite/ld-i386/code16.t: Likewise.
* testsuite/ld-x86-64/code16.d: Likewise.
* testsuite/ld-x86-64/code16.t: Likewise.
* testsuite/ld-i386/i386.exp: Run code16.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
|
|
* testsuite/ld-x86-64/ilp32-12.d: New file.
* testsuite/ld-x86-64/ilp32-12.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run ilp32-12.
|
|
ld/
* testsuite/ld-x86-64/rela.d: Fix regexp not to presume a specific
address layout, so it works for e.g. --target=x86-64-elf.
|
|
x86-64 uses rela relocations. The comment next to the field's declaration
says "Non-zero values for ELF USE_RELA targets should be viewed with
suspicion ..." And indeed the fields being non-zero causes section
contents to be accumulated into the final relocated values in addition to
the relocations' addends, which is contrary to the ELF spec.
|
|
The only insn requiring a truly 16-bit PC-relative relocation outside of
16-bit mode is XBEGIN (with an operand size override). For it, the
relocation generated should behave similar to 8- and (for 64-bit) 32-bit
PC-relatives ones, i.e. be checked for a signed value to fit the field.
This same mode is also correct for 16-bit code. Outside of 16-bit code,
branches with operand size overrides act in a truly PC-relative way only
when living in the low 32k of address space, as they truncate rIP to 16
bits. This can't be expressed by a PC-relative relocation.
Putting in place a new testcase, I'd like to note that the two existing
ones (pcrel16 and pcrel16abs) appear to be pretty pointless: They don't
expect any error despite supposedly checking for overflow, and in fact
there can't possibly be any error for the
- former since gas doesn't emit any relocation in the first place there,
- latter because the way the relocation gets expressed by gas doesn't
allow the linker to notice the overflow; it should be detected by gas
if at all, but see above (an error would be reported here for x86-64
afaict, but this test doesn't get re-used there).
|
|
PR ld/27590
* testsuite/ld-x86-64/pr27590.rd: New file.
* testsuite/ld-x86-64/pr27590a.obj.bz2: Likewise.
* testsuite/ld-x86-64/pr27590b.obj.bz2: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run ld/27590 test.
|
|
Check version >= 3, instead of version == 3 || version == 4, for
DW_FORM_ref_addr.
bfd/
PR ld/27587
* dwarf2.c (read_attribute_value): Check version >= 3 for
DW_FORM_ref_addr.
ld/
PR ld/27587
* testsuite/ld-x86-64/pr27587.err: New file.
* testsuite/ld-x86-64/pr27587a.obj.bz2: Likewise.
* testsuite/ld-x86-64/pr27587b.obj.bz2: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/27587 test.
|
|
When linking Windows x86-64 relocatable object files to generate x86-64
ELF executable, we need to subtract __ImageBase, aka __executable_start,
for R_AMD64_IMAGEBASE relocation:
1. Add link_info to struct output_elf_obj_tdata to store linker info and
_bfd_get_link_info() to retrieve it.
2. Add ldelf_set_output_arch to set up link_info.
3. Add pex64_link_add_symbols to create an indirect reference to
__executable_start for __ImageBase to support R_AMD64_IMAGEBASE relocation
when adding symbols from Windows x86-64 relocatable object files to
generate x86-64 ELF executable.
4. Also subtract __ImageBase for R_AMD64_IMAGEBASE when generating x86-64
ELF executable.
bfd/
PR ld/27425
PR ld/27432
* bfd.c (_bfd_get_link_info): New function.
* elf-bfd.h (output_elf_obj_tdata): Add link_info.
(elf_link_info): New.
* libbfd-in.h (_bfd_get_link_info): New prototype.
* coff-x86_64.c (coff_amd64_reloc): Also subtract __ImageBase for
R_AMD64_IMAGEBASE when generating x86-64 ELF executable.
* pe-x86_64.c: Include "coff/internal.h" and "libcoff.h".
(pex64_link_add_symbols): New function.
(coff_bfd_link_add_symbols): New macro.
* libbfd.h: Regenerated.
ld/
PR ld/27425
PR ld/27432
* ldelf.c (ldelf_set_output_arch): New function.
* ldelf.h (ldelf_set_output_arch): New prototype.
* emultempl/elf.em (LDEMUL_SET_OUTPUT_ARCH): Default to
ldelf_set_output_arch.
* ld-x86-64/pe-x86-64-1.od: Expect __executable_start.
* testsuite/ld-x86-64/pe-x86-64-2.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-5.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-5.rd: Likewise.
* testsuite/ld-x86-64/pe-x86-64-6.obj.bz2: New file.
* testsuite/ld-x86-64/pe-x86-64-6.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64.exp: Run ld/27425 test.
|
|
binutils/
PR binutils/27445
* readelf.c (print_gnu_property_note): Replace procesor with
processor.
ld/
PR binutils/27445
* testsuite/ld-i386/property-x86-isa1.d: Replace procesor with
processor.
* testsuite/ld-x86-64/property-x86-isa1-x32.d: Likewise.
* testsuite/ld-x86-64/property-x86-isa1.d: Likewise.
|
|
Remove x86 ISA level run-time tests since with glibc 2.33, they will fail
to run on machines with lesser x86 ISA level:
tmpdir/property-5-pie: CPU ISA level is lower than required
PR ld/27358
* testsuite/ld-i386/i386.exp: Remove property 3/4/5 run-time
tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
|
|
Provide
[hjl@gnu-cfl-2 ld]$ ./ld-new -z norelro -L/export/gnu/import/git/gitlab/x86-binutils/ld/testsuite/ld-x86-64 -melf32_x86_64 -Ttext=0x80000000 -o tmpdir/dump tmpdir/pr19609-7.o
tmpdir/pr19609-7.o: in function `_start':
(.text+0x2): failed to convert GOTPCREL relocation against 'foobar'; relink with --no-relax
[hjl@gnu-cfl-2 ld]$
instead of
[hjl@gnu-cfl-2 ld]$ ld -z norelro -L/export/gnu/import/git/gitlab/x86-binutils/ld/testsuite/ld-x86-64 -melf32_x86_64 -Ttext=0x80000000 -o tmpdir/dump tmpdir/pr19609-7.o
ld: failed to convert GOTPCREL relocation; relink with --no-relax
[hjl@gnu-cfl-2 ld]$
bfd/
PR ld/19609
* elf64-x86-64.c (elf_x86_64_relocate_section): Provide more
info when failed to convert GOTPCREL relocation.
ld/
PR ld/19609
* testsuite/ld-x86-64/pr19609-2a.d: Updated.
* testsuite/ld-x86-64/pr19609-2b.d: Likewise.
* testsuite/ld-x86-64/pr19609-4a.d: Likewise.
* testsuite/ld-x86-64/pr19609-4c.d: Likewise.
* testsuite/ld-x86-64/pr19609-5d.d: Likewise.
* testsuite/ld-x86-64/pr19609-7a.d: Likewise.
* testsuite/ld-x86-64/pr19609-7c.d: Likewise.
|
|
Pass -mx86-used-note=no to assembler.
* testsuite/ld-x86-64/bnd-plt-1.d: Fix a typo.
|
|
Linker generated relative relocations don't have symbol info:
[hjl@gnu-cfl-2 tmpdir]$ readelf -rW dump
Relocation section '.rela.dyn' at offset 0x180 contains 2 entries:
Offset Info Type Sym. Value Symbol's Name + Addend
00002f70 00000008 R_X86_64_RELATIVE 1000
00002f68 00000025 R_X86_64_IRELATIVE 1007
[hjl@gnu-cfl-2 tmpdir]$
Add -z report-relative-reloc to x86 ELF linker to report dynamic relative
relocations:
[hjl@gnu-cfl-2 tmpdir]$ ../ld-new -pie -melf32_x86_64 -z report-relative-reloc -o dump report-reloc-1.o
dump: R_X86_64_IRELATIVE (offset: 0x00002f68, info: 0x00000025, addend: 0x00001007) against 'ifunc' for section '.data.rel.ro.local' in report-reloc-1.o
dump: R_X86_64_RELATIVE (offset: 0x00002f70, info: 0x00000008, addend: 0x00001000) against '_start' for section '.data.rel.ro.local' in report-reloc-1.o
[hjl@gnu-cfl-2 tmpdir]$
It can be used to map relative relocations to corresponding symbols.
bfd/
* elf-linker-x86.h (elf_linker_x86_params): Add
report_relative_reloc.
* elf32-i386.c (elf_i386_relocate_section): Call
_bfd_x86_elf_link_report_relative_reloc to report relative
relocations for -z report-relative-reloc.
(elf_i386_finish_dynamic_symbol): Likewse.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewse.
(elf_x86_64_finish_dynamic_symbol): Likewse.
* elfxx-x86.c (_bfd_x86_elf_link_report_relative_reloc): New
function.
* elfxx-x86.h (_bfd_x86_elf_link_report_relative_reloc): New
prototype.
ld/
* NEWS: Mention -z report-relative-reloc.
* ld.texi: Document -z report-relative-reloc.
* emulparams/elf32_x86_64.sh: Source x86-report-relative.sh.
* emulparams/elf_i386.sh: Likewse.
* emulparams/elf_x86_64.sh: Likewse.
* emulparams/x86-report-relative.sh: New file.
* testsuite/ld-i386/report-reloc-1.d: Likewse.
* testsuite/ld-i386/report-reloc-1.l: Likewse.
* testsuite/ld-i386/report-reloc-1.s: Likewse.
* testsuite/ld-x86-64/report-reloc-1-x32.d: Likewse.
* testsuite/ld-x86-64/report-reloc-1.d: Likewse.
* testsuite/ld-x86-64/report-reloc-1.l: Likewse.
* testsuite/ld-x86-64/report-reloc-1.s: Likewse.
* testsuite/ld-i386/i386.exp: Run report-reloc-1.
* testsuite/ld-x86-64/x86-64.exp: Run report-reloc-1 and
report-reloc-1-x32.
|
|
Subtract the value of the section contents for R_AMD64_DIR64 and
R_AMD64_DIR32 relocations when generating ELF output from PE/x86-64
inputs.
bfd/
PR ld/27171
* reloc.c (bfd_perform_relocation): Adjust R_AMD64_DIR64 and
R_AMD64_DIR32 relocations for PE/x86-64 inputs.
ld/
PR ld/27171
* testsuite/ld-x86-64/pe-x86-64-5.obj.bz2: New file.
* testsuite/ld-x86-64/pe-x86-64-5.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-5.rd: Likewise.
* testsuite/ld-x86-64/pe-x86-64.exp: Run PR ld/27171 test.
|
|
Properly merge GNU properties for LAM_U48 and LAM_U57.
bfd/
PR ld/27166
* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle
-z lam-u48 and -z lam-u57.
ld/
PR ld/27166
* testsuite/ld-x86-64/lam-u48.rd: New file.
* testsuite/ld-x86-64/lam-u57.rd: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Add PR ld/27166 tests.
|
|
Since LAM_U48 implies LAM_U57, also set LAM_U57 when setting LAM_U48.
bfd/
* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Also set
LAM_U57 when setting LAM_U48.
ld/
* ld-x86-64/property-x86-lam-u48-4.d: Updated.
* ld-x86-64/property-x86-lam-u48-5.d: Likewise.
|
|
For ELF targets, section symbols are required only for relocations.
With -ffunction-sections -fdata-sections, there can be many unused
section symbols. Sizes of libstdc++.a on Linux/x86-64 in GCC 11 are
With unused section symbols : 39411698 bytes
Without unused section symbols: 39227002 bytes
The unused section symbols in libstdc++.a occupy more than 180 KB.
Add BSF_SECTION_SYM_USED to indicate if a section symbol should be
included in the symbol table. The BSF_SECTION_SYM_USED should be set
if the section symbol is used for relocation or the section symbol is
always included in the symbol table.
Add keep_unused_section_symbols to bfd_target to indicate if unused
section symbols should be kept. If TARGET_KEEP_UNUSED_SECTION_SYMBOLS
is defined as FALSE, unused ection symbols will be removed.
Tested on Linux/x86. Other ELF backends need to:
1. Define TARGET_KEEP_UNUSED_SECTION_SYMBOLS to FALSE.
2. Mark used section symbols in assembler backend.
3. Remove unused section symbols from expected assembler and linker
outputs.
bfd/
PR 27109
* aix386-core.c (core_aix386_vec): Initialize
keep_unused_section_symbol to TARGET_KEEP_UNUSED_SECTION_SYMBOLS.
* aout-target.h (MY (vec)): Likewise.
* binary.c (binary_vec): Likewise.
* cisco-core.c (core_cisco_be_vec): Likewise.
(core_cisco_le_vec): Likewise.
* coff-alpha.c (alpha_ecoff_le_vec): Likewise.
* coff-i386.c (TARGET_SYM): Likewise.
(TARGET_SYM_BIG): Likewise.
* coff-ia64.c (TARGET_SYM): Likewise.
* coff-mips.c (mips_ecoff_le_vec): Likewise.
(mips_ecoff_be_vec): Likewise.
(mips_ecoff_bele_vec): Likewise.
* coff-rs6000.c (rs6000_xcoff_vec): Likewise.
(powerpc_xcoff_vec): Likewise.
* coff-sh.c (sh_coff_small_vec): Likewise.
(sh_coff_small_le_vec): Likewise.
* coff-tic30.c (tic30_coff_vec): Likewise.
* coff-tic54x.c (tic54x_coff0_vec): Likewise.
(tic54x_coff0_beh_vec): Likewise.
(tic54x_coff1_vec): Likewise.
(tic54x_coff1_beh_vec): Likewise.
(tic54x_coff2_vec): Likewise.
(tic54x_coff2_beh_vec): Likewise.
* coff-x86_64.c (TARGET_SYM): Likewise.
(TARGET_SYM_BIG): Likewise.
* coff64-rs6000.c (rs6000_xcoff64_vec): Likewise.
(rs6000_xcoff64_aix_vec): Likewise.
* coffcode.h (CREATE_BIG_COFF_TARGET_VEC): Likewise.
(CREATE_BIGHDR_COFF_TARGET_VEC): Likewise.
(CREATE_LITTLE_COFF_TARGET_VEC): Likewise.
* elfxx-target.h (TARGET_BIG_SYM): Likewise.
(TARGET_LITTLE_SYM): Likewise.
* hppabsd-core.c (core_hppabsd_vec): Likewise.
* hpux-core.c (core_hpux_vec): Likewise.
* i386msdos.c (i386_msdos_vec): Likewise.
* ihex.c (ihex_vec): Likewise.
* irix-core.c (core_irix_vec): Likewise.
* mach-o-target.c (TARGET_NAME): Likewise.
* mmo.c (mmix_mmo_vec): Likewise.
* netbsd-core.c (core_netbsd_vec): Likewise.
* osf-core.c (core_osf_vec): Likewise.
* pdp11.c (MY (vec)): Likewise.
* pef.c (pef_vec): Likewise.
(pef_xlib_vec): Likewise.
* plugin.c (plugin_vec): Likewise.
* ppcboot.c (powerpc_boot_vec): Likewise.
* ptrace-core.c (core_ptrace_vec): Likewise.
* sco5-core.c (core_sco5_vec): Likewise.
* som.c (hppa_som_vec): Likewise.
* srec.c (srec_vec): Likewise.
(symbolsrec_vec): Likewise.
* tekhex.c (tekhex_vec): Likewise.
* trad-core.c (core_trad_vec): Likewise.
* verilog.c (verilog_vec): Likewise.
* vms-alpha.c (alpha_vms_vec): Likewise.
* vms-lib.c (alpha_vms_lib_txt_vec): Likewise.
* wasm-module.c (wasm_vec): Likewise.
* xsym.c (sym_vec): Likewise.
* elf.c (ignore_section_sym): Return TRUE if BSF_SECTION_SYM_USED
isn't set.
(elf_map_symbols): Don't include ignored section symbols.
* elfcode.h (elf_slurp_symbol_table): Also set
BSF_SECTION_SYM_USED on STT_SECTION symbols.
* elflink.c (bfd_elf_final_link): Generated section symbols only
when emitting relocations or reqired.
* elfxx-x86.h (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
* syms.c (BSF_SECTION_SYM_USED): New.
* targets.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
(bfd_target): Add keep_unused_section_symbols.
(bfd_keep_unused_section_symbols): New.
* bfd-in2.h: Regenerated.
binutils/
PR 27109
* objcopy.c (copy_object): Handle section symbols for
non-relocatable inputs.
* testsuite/binutils-all/readelf.exp (readelf_test): Check
is_elf_unused_section_symbols.
* testsuite/binutils-all/readelf.s-64: Updated.
* testsuite/binutils-all/readelf.ss: Likewise.
* testsuite/binutils-all/readelf.ss-64: Likewise.
* testsuite/binutils-all/readelf.s-64-unused: New file.
* testsuite/binutils-all/readelf.ss-64-unused: Likewise.
* testsuite/binutils-all/readelf.ss-unused: Likewise.
* testsuite/lib/binutils-common.exp
(is_elf_unused_section_symbols): New proc.
gas/ChangeLog:
PR 27109
* read.c (s_reloc): Call symbol_mark_used_in_reloc on the
section symbol.
* subsegs.c (subseg_set_rest): Set BSF_SECTION_SYM_USED if needed.
* write.c (adjust_reloc_syms): Call symbol_mark_used_in_reloc
on the section symbol.
(set_symtab): Don't generate unused section symbols.
(maybe_generate_build_notes): Call symbol_mark_used_in_reloc
on the section symbol.
* config/obj-elf.c (elf_adjust_symtab): Call
symbol_mark_used_in_reloc on the group signature symbol.
* testsuite/gas/cfi/cfi-label.d: Remove unused section symbols
from expected output.
* testsuite/gas/elf/elf.exp (run_elf_list_test): Check
is_elf_unused_section_symbols.
* testsuite/gas/elf/section2.e: Updated.
* testsuite/gas/elf/section2.e-unused: New file.
* testsuite/gas/elf/symver.d: Remove unused section symbols.
* testsuite/gas/i386/ilp32/elf/symver.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-size-1.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-size-3.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-size-5.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-unwind.d: Likewise.
* testsuite/gas/i386/size-1.d: Likewise.
* testsuite/gas/i386/size-3.d: Likewise.
* testsuite/gas/i386/svr4.d: Likewise.
* testsuite/gas/i386/x86-64-size-1.d: Likewise.
* testsuite/gas/i386/x86-64-size-3.d: Likewise.
* testsuite/gas/i386/x86-64-size-5.d: Likewise.
* testsuite/gas/i386/x86-64-unwind.d: Likewise.
ld/
PR 27109
* testsuite/ld-elf/export-class.sd: Adjust the expected output.
* testsuite/ld-elf/loadaddr3b.d: Likewise.
* testsuite/ld-i386/ibt-plt-1.d: Likewise.
* testsuite/ld-i386/ibt-plt-2a.d: Likewise.
* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
* testsuite/ld-i386/pr19636-1d.d: Likewise.
* testsuite/ld-i386/pr19636-1l.d: Likewise.
* testsuite/ld-i386/pr19636-2c.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise.
* testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise.
* testsuite/ld-ifunc/pr17154-i386-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-i386.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
* testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.
* testsuite/ld-x86-64/pr19609-4e.d: Likewise.
* testsuite/ld-x86-64/pr19609-6a.d: Likewise.
* testsuite/ld-x86-64/pr19609-6b.d: Likewise.
* testsuite/ld-x86-64/pr19609-7b.d: Likewise.
* testsuite/ld-x86-64/pr19609-7d.d: Likewise.
* testsuite/ld-x86-64/pr19636-2l.d: Likewise.
* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
* testsuite/ld-x86-64/pr20253-1h.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038b.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
* testsuite/ld-x86-64/pr23854.d: Likewise.
* testsuite/ld-x86-64/pr25416-3.d: Likewise.
* testsuite/ld-x86-64/pr25416-4.d: Likewise.
* testsuite/ld-i386/plt-pic.pd: Likewise.
* testsuite/ld-i386/plt-pic2.dd: Likewise.
* testsuite/ld-i386/plt.pd: Likewise.
* testsuite/ld-i386/plt2.dd: Likewise.
* testsuite/ld-i386/tlsbin.rd: Likewise.
* testsuite/ld-i386/tlsbin2.rd: Likewise.
* testsuite/ld-i386/tlsbindesc.rd: Likewise.
* testsuite/ld-i386/tlsdesc.rd: Likewise.
* testsuite/ld-i386/tlsgdesc.rd: Likewise.
* testsuite/ld-i386/tlsnopic.rd: Likewise.
* testsuite/ld-i386/tlspic.rd: Likewise.
* testsuite/ld-i386/tlspic2.rd: Likewise.
* testsuite/ld-x86-64/mpx3.dd: Likewise.
* testsuite/ld-x86-64/mpx3n.dd: Likewise.
* testsuite/ld-x86-64/mpx4.dd: Likewise.
* testsuite/ld-x86-64/mpx4n.dd: Likewise.
* testsuite/ld-x86-64/pe-x86-64-1.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-2.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4.od: Likewise.
* testsuite/ld-x86-64/plt.pd: Likewise.
* testsuite/ld-x86-64/plt2.dd: Likewise.
* testsuite/ld-x86-64/tlsbin.rd: Likewise.
* testsuite/ld-x86-64/tlsbin2.rd: Likewise.
* testsuite/ld-x86-64/tlsbindesc.rd: Likewise.
* testsuite/ld-x86-64/tlsdesc.rd: Likewise.
* testsuite/ld-x86-64/tlsgdesc.rd: Likewise.
* testsuite/ld-x86-64/tlspic.rd: Likewise.
* testsuite/ld-x86-64/tlspic2.rd: Likewise.
* testsuite/ld-elf/sec64k.exp: Check
is_elf_unused_section_symbols.
|
|
bfd/
PR 26822
* elflink.c (elf_link_input_bfd): Use the file base name in
linker generated STT_FILE symbols.
ld/
PR 26822
* testsuite/ld-arm/non-contiguous-arm2.d: Adjust STT_FILE symbol match.
* testsuite/ld-arm/non-contiguous-arm3.d: Likewise.
* testsuite/ld-arm/non-contiguous-arm5.d: Likewise.
* testsuite/ld-arm/non-contiguous-arm6.d: Likewise.
* testsuite/ld-i386/tlsbin.rd: Likewise.
* testsuite/ld-i386/tlsbin2.rd: Likewise.
* testsuite/ld-i386/tlsbindesc.rd: Likewise.
* testsuite/ld-i386/tlsdesc.rd: Likewise.
* testsuite/ld-i386/tlsnopic.rd: Likewise.
* testsuite/ld-i386/tlspic.rd: Likewise.
* testsuite/ld-i386/tlspic2.rd: Likewise.
* testsuite/ld-mips-elf/global-local-symtab-sort-n64.d: Likewise.
* testsuite/ld-mips-elf/global-local-symtab-sort-n64t.d: Likewise.
* testsuite/ld-mips-elf/global-local-symtab-sort-o32.d: Likewise.
* testsuite/ld-mips-elf/global-local-symtab-sort-o32t.d: Likewise.
* testsuite/ld-plugin/pr17973.d: Likewise.
* testsuite/ld-tic6x/shlib-1.rd: Likewise.
* testsuite/ld-tic6x/shlib-1b.rd: Likewise.
* testsuite/ld-tic6x/shlib-1r.rd: Likewise.
* testsuite/ld-tic6x/shlib-1rb.rd: Likewise.
* testsuite/ld-tic6x/shlib-app-1.rd: Likewise.
* testsuite/ld-tic6x/shlib-app-1b.rd: Likewise.
* testsuite/ld-tic6x/shlib-app-1r.rd: Likewise.
* testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise.
* testsuite/ld-tic6x/shlib-noindex.rd: Likewise.
* testsuite/ld-tic6x/static-app-1.rd: Likewise.
* testsuite/ld-tic6x/static-app-1b.rd: Likewise.
* testsuite/ld-tic6x/static-app-1r.rd: Likewise.
* testsuite/ld-tic6x/static-app-1rb.rd: Likewise.
* testsuite/ld-x86-64/tlsbin.rd: Likewise.
* testsuite/ld-x86-64/tlsbin2.rd: Likewise.
* testsuite/ld-x86-64/tlsbindesc.rd: Likewise.
* testsuite/ld-x86-64/tlsdesc.rd: Likewise.
* testsuite/ld-x86-64/tlspic.rd: Likewise.
* testsuite/ld-x86-64/tlspic2.rd: Likewise.
* testsuite/ld-xtensa/tlsbin.rd: Likewise.
* testsuite/ld-xtensa/tlspic.rd: Likewise.
|
|
|
|
Add Intel Linear Address Masking (LAM) property support. LAM modifies
the checking that is applied to 64-bit linear addresses, allowing
software to use of the untranslated address bits for metadata.
bfd/
* elf-linker-x86.h (elf_x86_cet_report): Renamed to ...
(elf_x86_prop_report): This.
(elf_linker_x86_params): Add lam_u48, lam_u57, lam_u48_report
and lam_u57_report.
* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Support
GNU_PROPERTY_X86_FEATURE_1_LAM_U48 and
GNU_PROPERTY_X86_FEATURE_1_LAM_U57.
(_bfd_x86_elf_link_fixup_gnu_properties): Keep LAM features only
for 64-bit output.
binutils/
* NEWS: Mention LAM_U48 and LAM_U57 support.
* elfedit.c (elf_x86_feature): Support lam_u48 and lam_u57.
(usage): Add lam_u48 and lam_u57.
* readelf.c (decode_x86_feature_1): Support LAM_U48 and LAM_U57.
* doc/binutils.texi: Update elfedit with lam_u48 and lam_u57
support.
* testsuite/binutils-all/x86-64/lam-u48.d: New file.
* testsuite/binutils-all/x86-64/lam-u48.s: Likewise.
* testsuite/binutils-all/x86-64/lam-u57.d: Likewise.
* testsuite/binutils-all/x86-64/lam-u57.s: Likewise.
include/
* elf/common.h (GNU_PROPERTY_X86_FEATURE_1_LAM_U48): New.
(GNU_PROPERTY_X86_FEATURE_1_LAM_U57): Likewise.
ld/
* NEWS: Mention LAM_U48 and LAM_U57 support.
* ld.texi: Document LAM_U48 and LAM_U57 support.
* emulparams/cet.sh: Updated.
* emulparams/elf_x86_64.sh: Source x86-64-lam.sh.
* emulparams/x86-64-lam.sh: New file.
* testsuite/ld-x86-64/property-x86-lam-u48-1a.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u48-1b.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u48-2.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u48-3a.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u48-3b.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u48-4.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u48-5.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u48.s: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57-1a.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57-1b.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57-2.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57-3a.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57-3b.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57-4.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57-5.d: Likewise.
* testsuite/ld-x86-64/property-x86-lam-u57.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run LAM tests.
|
|
Since converting load to mov needs to rewrite the REX byte and we don't
know if there is a REX byte with GOTPCREL relocation, do it only for
GOTPCRELX relocations.
bfd/
PR ld/27016
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Convert load
to mov only for GOTPCRELX relocations.
ld/
PR ld/27016
* testsuite/ld-x86-64/x86-64.exp: Run pr27016a and pr27016b.
* testsuite/ld-x86-64/pr27016a.d: New file.
* testsuite/ld-x86-64/pr27016a.s: Likewise.
* testsuite/ld-x86-64/pr27016b.d: Likewise.
* testsuite/ld-x86-64/pr27016b.s: Likewise.
|
|
GOTPCRELX relocations can be transformed only when addend == -4. Add
tests for GOTPCRELX relocations with addend != -4.
PR gold/26939
* testsuite/ld-x86-64/pr26939-x32.d: New file.
* testsuite/ld-x86-64/pr26939.d: Likewise.
* testsuite/ld-x86-64/pr26939.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR gold/26939 tests.
|
|
"In 64-bit mode, the CS, DS, ES, and SS segment-override prefixes have
no effect. These four prefixes are not treated as segment-override
prefixes for the purposes of multiple-prefix rules. Instead, they are
treated as null prefixes." (AMD APM v2).
However, objdump disassembles instructions containing those ignored
prefixes by still generating that segment override:
66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1)
00 00 00 00
Print those segment override prefixes as excessive ones:
66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1)
00 00 00 00
which is what they actually are - they have no effect and the decoding
hardware ignores them.
gas/
2020-11-14 Borislav Petkov <bp@suse.de>
* testsuite/gas/i386/x86-64-segovr.d: Adjust regexes.
* testsuite/gas/i386/x86-64-nops.d: Likewise.
* testsuite/gas/i386/x86-64-nops-1.d: Likewise.
* testsuite/gas/i386/x86-64-nops-1-g64.d: Likewise.
* testsuite/gas/i386/x86-64-nops-1-core2.d: Likewise.
* testsuite/gas/i386/x86-64-nops-1-k8.d: Likewise.
* testsuite/gas/i386/x86-64-nops-2.d: Likewise.
* testsuite/gas/i386/x86-64-nops-3.d: Likewise.
* testsuite/gas/i386/x86-64-nops-4.d: Likewise.
* testsuite/gas/i386/x86-64-nops-4-core2.d: Likewise.
* testsuite/gas/i386/x86-64-nops-4-k8.d: Likewise.
* testsuite/gas/i386/x86-64-nops-5.d: Likewise.
* testsuite/gas/i386/x86-64-nops-5-k8.d: Likewise.
* testsuite/gas/i386/x86-64-nops-7.d: Likewise.
* testsuite/gas/i386/x86-64-nop-1.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-1a.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-1b.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-1c.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-1d.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-1g.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-2c.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-6.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-7.d: Likewise.
* testsuite/gas/i386/x86-64-align-branch-8.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-1-core2.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-1-k8.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-1.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-2.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-3.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-4-core2.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-4-k8.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-4.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-5-k8.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops-5.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-nops.d:: Likewise.
ld/
2020-11-14 Borislav Petkov <bp@suse.de>
* testsuite/ld-x86-64/pe-x86-64-4.od: Adjust regexes.
* testsuite/ld-x86-64/tlsld3.dd: Likewise.
* testsuite/ld-x86-64/tlsld4.dd: Likewise.
opcodes/
2020-11-14 Borislav Petkov <bp@suse.de>
* i386-dis.c (ckprefix): Do not assign active_seg_prefix in
64-bit addressing mode.
(NOTRACK_Fixup): Test prefixes for PREFIX_DS, instead of
active_seg_prefix.
|