Compare commits
235 Commits
Author | SHA1 | Date |
---|---|---|
Miloš Prchlík | 0b79ce8f56 | |
Nick Clifton | 3cf8e1bc9f | |
Adam Williamson | 0f2aecfa1d | |
Adam Williamson | 197ad6bd2d | |
Adam Williamson | ff81d4f57b | |
Adam Williamson | 40a88f45f0 | |
Adam Williamson | a674e44e6d | |
Nick Clifton | e650482c03 | |
Nick Clifton | b11a13f3f3 | |
Nick Clifton | 6bfd06790b | |
Fedora Release Engineering | 3ac2843cab | |
Nick Clifton | 66f76524de | |
Miloš Prchlík | 6765525905 | |
Nick Clifton | 7ef644fbf6 | |
Nick Clifton | 14fb249724 | |
Nick Clifton | 78fe7f4703 | |
Nick Clifton | e27610f6a7 | |
Nick Clifton | dd133b6b81 | |
Nick Clifton | 92265683bf | |
Nick Clifton | 4a4bd90398 | |
Luca Boccassi | 44cef29673 | |
Luca Boccassi | 1fb1ae3dd6 | |
Nick Clifton | 9ee9ffc894 | |
Nick Clifton | 0859b9f54c | |
Nick Clifton | 17f6d21f57 | |
Nick Clifton | 544bea2339 | |
Amit Shah | fa2df7c5e7 | |
Nick Clifton | 1b1ba83846 | |
Fedora Release Engineering | fc45567d6a | |
Nick Clifton | 3b3292ed1e | |
Nick Clifton | fa5c6f55b2 | |
Nick Clifton | 4c13eef881 | |
Nick Clifton | 7fccd0d7e7 | |
Nick Clifton | 2d6725c1a9 | |
Nick Clifton | fae26da53a | |
Nick Clifton | 15c0289a28 | |
Nick Clifton | 97c0e8e507 | |
Nick Clifton | 2749aba2e5 | |
Nick Clifton | 107db84d77 | |
Nick Clifton | b223b873be | |
Nick Clifton | f02d283cbb | |
Nick Clifton | 9c952780c9 | |
Nick Clifton | c0d31e974b | |
Nick Clifton | 467b87538d | |
Nick Clifton | 6bd3a0b7c2 | |
Nick Clifton | 4a7c8e040b | |
Nick Clifton | c074b4afae | |
Nick Clifton | d685480361 | |
Nick Clifton | b04b2360b7 | |
Václav Kadlčík | 10575a5d52 | |
Nick Clifton | ea9a413173 | |
Nick Clifton | 24c5f0f956 | |
Nick Clifton | c13a28efbc | |
Fedora Release Engineering | 95c35f80af | |
Nick Clifton | 9a25c9f346 | |
Nick Clifton | 14b1fc0e7b | |
Luca Boccassi | a2393deeee | |
Nick Clifton | 893b61d358 | |
Nick Clifton | 94be2cd1fb | |
Martin Cermak | 5bb4d15d3c | |
Nick Clifton | 5074d55c3d | |
Václav Kadlčík | 5dbfbba047 | |
Luca Boccassi | 5f97030592 | |
Luca Boccassi | df67e06692 | |
Nick Clifton | 86336d536a | |
Nick Clifton | 9e8ef94636 | |
Orion Poplawski | ca8ef33300 | |
Timm Bäder | 47508dc848 | |
Nick Clifton | 92a1236ab3 | |
Nick Clifton | 752fe419ea | |
Nick Clifton | e59cdcdfc5 | |
Tom Stellard | 73c2d21c11 | |
Nick Clifton | 75c516c6c2 | |
Nick Clifton | 50232d48dc | |
Nick Clifton | dcb64b3d34 | |
Stephen Gallagher | 252f93244d | |
Nick Clifton | a2d562c07d | |
Nick Clifton | f4ad5792af | |
Nick Clifton | ffc81ff11e | |
Nick Clifton | 01ca902e23 | |
Fedora Release Engineering | d5ffebd3b7 | |
Nick Clifton | 9eaca4038a | |
Nick Clifton | 6d1ff8eb0b | |
Nick Clifton | 90f5896dac | |
Václav Kadlčík | acab70872f | |
Václav Kadlčík | 24cc8051d1 | |
Václav Kadlčík | 58f355fcc3 | |
Nick Clifton | fba59c4283 | |
Nick Clifton | fb7c644d99 | |
Václav Kadlčík | c82e600f3f | |
Nick Clifton | 3ebde0f76b | |
Nick Clifton | a4b106ec38 | |
Václav Kadlčík | 284ad2a04b | |
Václav Kadlčík | 8b9a64065d | |
Václav Kadlčík | 518691547f | |
Václav Kadlčík | 8d1431acf8 | |
Václav Kadlčík | f5c84aa932 | |
Václav Kadlčík | 473ccf2683 | |
Václav Kadlčík | 54c8d3242b | |
Nick Clifton | 2680508b04 | |
Václav Kadlčík | 0b3adba8ff | |
Nick Clifton | fc998ec612 | |
Václav Kadlčík | 5069c58e30 | |
Nick Clifton | 616b9e8e44 | |
Václav Kadlčík | 64cf74e8a3 | |
Václav Kadlčík | 22348da57d | |
Václav Kadlčík | 8e50243c45 | |
Václav Kadlčík | 95e9eaea23 | |
Václav Kadlčík | 3740b5fe3f | |
Václav Kadlčík | 2c6bc398b0 | |
Václav Kadlčík | fe3f218ee7 | |
Václav Kadlčík | ba92017b68 | |
Václav Kadlčík | 14a74d027d | |
Václav Kadlčík | 1f73172fe0 | |
Václav Kadlčík | 001cb68e0a | |
Václav Kadlčík | 22c57fab15 | |
Timm Bäder | 117b4ee5c2 | |
Timm Bäder | 5e669f0402 | |
Nick Clifton | 2c147eaf06 | |
Václav Kadlčík | 4594b7d025 | |
Václav Kadlčík | 37d46f62b4 | |
Václav Kadlčík | eb66e6ad98 | |
Václav Kadlčík | 248005fd4b | |
Václav Kadlčík | cf75a87f18 | |
Václav Kadlčík | aa0db47566 | |
Václav Kadlčík | 06dff1c717 | |
Václav Kadlčík | 6becef8c86 | |
Václav Kadlčík | 5368a04b59 | |
Václav Kadlčík | c58376bae6 | |
Václav Kadlčík | d8a8efd579 | |
Václav Kadlčík | 8b0542614c | |
Václav Kadlčík | b0c79a4304 | |
Václav Kadlčík | 6df1ce83dc | |
Václav Kadlčík | 0fc29a6fe4 | |
Václav Kadlčík | 31a5e2d113 | |
Václav Kadlčík | 4504773204 | |
Václav Kadlčík | 565577c240 | |
Václav Kadlčík | d78b2cccc1 | |
Václav Kadlčík | ae526f4dc7 | |
Václav Kadlčík | c468b0dfdd | |
Václav Kadlčík | 484107a803 | |
Václav Kadlčík | 9cd058771f | |
Václav Kadlčík | 57106a8254 | |
Václav Kadlčík | 6a906104d9 | |
Václav Kadlčík | e05b04d76b | |
Václav Kadlčík | c7ad9ce6c4 | |
Václav Kadlčík | e429ddcadc | |
Václav Kadlčík | 195ba30ad9 | |
Václav Kadlčík | a6c5799515 | |
Nick Clifton | 7453caeb33 | |
Nick Clifton | ac55f50329 | |
Nick Clifton | 0b119dd9d5 | |
Nick Clifton | e184e98697 | |
Nick Clifton | 2f53574f32 | |
Nick Clifton | e5b60c3bbb | |
Nick Clifton | 2e8b4af2b9 | |
Nick Clifton | e1785a2a4b | |
Nick Clifton | bbafdb8775 | |
Nick Clifton | c014d04d53 | |
Nick Clifton | 5cef9601f1 | |
Nick Clifton | 34f3e5e618 | |
Nicholas Clifton | 84771fa58a | |
Nick Clifton | 8bb6c79408 | |
Martin Cermak | 49b89d94ef | |
Martin Cermak | 044ff519e9 | |
Nick Clifton | 94c52a6c76 | |
Nick Clifton | 1c9437f634 | |
Nick Clifton | da81b23637 | |
Fedora Release Engineering | 90ca16a5d6 | |
Nick Clifton | 88880dcb05 | |
Václav Kadlčík | 1171dfa950 | |
Václav Kadlčík | 7294ce61bc | |
Václav Kadlčík | 4db8f84f7e | |
Václav Kadlčík | c29a5d4751 | |
Nick Clifton | 433c9b01d4 | |
Nick Clifton | d5e63f6505 | |
Nick Clifton | 0960a4713d | |
Nick Clifton | c3a1a4ef17 | |
Nick Clifton | eeeb57f8ed | |
Nick Clifton | e056abea7e | |
Nick Clifton | 5aee897b5c | |
Nick Clifton | 4b3b7c0eda | |
Tom Stellard | 1c6ed47920 | |
Florian Weimer | 05722a7935 | |
Nick Clifton | 0781ec435c | |
Nick Clifton | b69788edf8 | |
Nick Clifton | c9f1c0ef4c | |
Nick Clifton | 2040d52e17 | |
Nick Clifton | 540feda45b | |
Nick Clifton | 7c556a22c9 | |
Nick Clifton | 9138ef7327 | |
Nick Clifton | a4573e9c3e | |
Nick Clifton | 611c7aa70b | |
Nick Clifton | 63965bc14d | |
Nick Clifton | b5f49511e0 | |
Nick Clifton | a1dc8e2d32 | |
Nick Clifton | 45e67f9ccb | |
Nick Clifton | 9051ca66fa | |
Nick Clifton | 842839bbb1 | |
Nick Clifton | 13a86b8b66 | |
Nick Clifton | 2592e35890 | |
Nick Clifton | a04d2461fb | |
Nick Clifton | 2c9d39bc55 | |
Nick Clifton | 7e6a1748ba | |
Nick Clifton | 7691c28cb0 | |
Nick Clifton | ba80920a4c | |
Nick Clifton | 2e0c2015a5 | |
Nick Clifton | d62f898ae7 | |
Jeff Law | 7bb2daa612 | |
Jeff Law | e315473f6c | |
Nick Clifton | b22933e83e | |
Nick Clifton | 93bf869662 | |
Richard W.M. Jones | 6442193bff | |
Nick Clifton | 722dceebdb | |
Nick Clifton | a8b0efde87 | |
Nick Clifton | 3eb4862ad3 | |
Fedora Release Engineering | 74b3ce8462 | |
Jeff Law | 0af851ae02 | |
Nick Clifton | 15a78ff3d8 | |
Nick Clifton | 5cfc5a91d2 | |
Nick Clifton | 385f20222d | |
Jeff Law | 426edf4a6e | |
Jeff Law | 32bf168f75 | |
Nick Clifton | d8ce39864a | |
Nick Clifton | c548afa128 | |
Nick Clifton | 347bbd0dc5 | |
Nick Clifton | 72f99ab293 | |
Nick Clifton | e8f39243b8 | |
Nick Clifton | d1aeab2109 | |
Nick Clifton | 07a3e80865 | |
Nick Clifton | beb7b8e936 | |
Nick Clifton | 657e3d5a3e | |
Fedora Release Engineering | bf57373ec8 | |
Nick Clifton | dcf3d266fa | |
Nick Clifton | 7111265a8a |
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -1,20 +1,71 @@
|
|||
binutils-2.*/
|
||||
i386
|
||||
i686
|
||||
x86_64
|
||||
/binutils-*.tar.bz2
|
||||
.build-*
|
||||
*.src.rpm
|
||||
*.log
|
||||
HOWTO
|
||||
build-sources
|
||||
*.diff
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
/binutils-2.29.tar.xz
|
||||
/binutils-2.29.1.tar.xz
|
||||
*~
|
||||
.#*
|
||||
*#
|
||||
|
||||
*.flt
|
||||
*.gmo
|
||||
*.info
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
*.pyc
|
||||
*.tmp
|
||||
*.a
|
||||
|
||||
.deps
|
||||
.libs
|
||||
|
||||
autom4te.cache
|
||||
config.cache
|
||||
config.h
|
||||
config.intl
|
||||
config.log
|
||||
config.status
|
||||
libtool
|
||||
POTFILES
|
||||
*-POTFILES
|
||||
|
||||
TAGS
|
||||
TAGS.sub
|
||||
|
||||
.local.vimrc
|
||||
.lvimrc
|
||||
|
||||
.clang-format
|
||||
|
||||
.gdbinit
|
||||
.gdb_history
|
||||
|
||||
perf.data
|
||||
perf.data.old
|
||||
|
||||
# ignore core files, but not java/net/protocol/core/
|
||||
core
|
||||
!core/
|
||||
|
||||
lost+found
|
||||
|
||||
# ignore ./contrib/gcc_update output
|
||||
LAST_UPDATED
|
||||
REVISION
|
||||
|
||||
stamp-*
|
||||
*.stamp
|
||||
|
||||
# ignore in-tree prerequisites
|
||||
/mpfr*
|
||||
/mpc*
|
||||
/gmp*
|
||||
/isl*
|
||||
/binutils-2.34.0-5dfc0c955dbe912cd328fc2688e5fceb3239ac2a.tar.xz
|
||||
/binutils-2.19.50.0.1-output-format.sed
|
||||
/binutils-2.30.tar.xz
|
||||
/binutils-2.30.90.tar.xz
|
||||
/binutils-2.31.1.tar.xz
|
||||
/binutils-special-sections-in-groups.patch
|
||||
/binutils-2.32.tar.xz
|
||||
/binutils-2.33.1.tar.xz
|
||||
/binutils-2.35.tar.xz
|
||||
/binutils-2.35.1.tar.xz
|
||||
/binutils-2.36.1.tar.xz
|
||||
/binutils-2.37.tar.xz
|
||||
/binutils-2.38.tar.xz
|
||||
/binutils-2.39.tar.xz
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
# Generate OUTPUT_FORMAT line for .so files from the system linker output.
|
||||
# Imported from glibc/Makerules.
|
||||
|
||||
/ld.*[ ]-E[BL]/b f
|
||||
/collect.*[ ]-E[BL]/b f
|
||||
/OUTPUT_FORMAT[^)]*$/{N
|
||||
s/\n[ ]*/ /
|
||||
}
|
||||
t o
|
||||
: o
|
||||
s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
|
||||
t q
|
||||
s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/
|
||||
t s
|
||||
s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
|
||||
t q
|
||||
d
|
||||
: s
|
||||
s/"//g
|
||||
G
|
||||
s/\n//
|
||||
s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p
|
||||
s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p
|
||||
s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p
|
||||
/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p
|
||||
q
|
||||
: q
|
||||
s/"//g
|
||||
p
|
||||
q
|
||||
: f
|
||||
s/^.*[ ]-E\([BL]\)[ ].*$/,\1/
|
||||
t h
|
||||
s/^.*[ ]-E\([BL]\)$/,\1/
|
||||
t h
|
||||
d
|
||||
: h
|
||||
h
|
|
@ -1,15 +0,0 @@
|
|||
--- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100
|
||||
+++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100
|
||||
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
|
||||
ssize_t bytes;
|
||||
if (this->whole_file_view_ != NULL)
|
||||
{
|
||||
+ // See PR 23765 for an example of a testcase that triggers this error.
|
||||
+ if (((ssize_t) start) < 0)
|
||||
+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
|
||||
+ this->filename().c_str(),
|
||||
+ static_cast<long long>(start));
|
||||
+
|
||||
bytes = this->size_ - start;
|
||||
if (static_cast<section_size_type>(bytes) >= size)
|
||||
{
|
|
@ -1,62 +0,0 @@
|
|||
--- binutils.orig/bfd/dwarf2.c 2019-11-13 11:49:52.211121564 +0000
|
||||
+++ binutils-2.33.1/bfd/dwarf2.c 2019-11-13 11:53:26.991423055 +0000
|
||||
@@ -2813,8 +2813,8 @@ static bfd_boolean comp_unit_maybe_decod
|
||||
|
||||
static bfd_boolean
|
||||
find_abstract_instance (struct comp_unit * unit,
|
||||
- bfd_byte * orig_info_ptr,
|
||||
struct attribute * attr_ptr,
|
||||
+ unsigned int recur_count,
|
||||
const char ** pname,
|
||||
bfd_boolean * is_linkage,
|
||||
char ** filename_ptr,
|
||||
@@ -2829,6 +2829,14 @@ find_abstract_instance (struct comp_unit
|
||||
struct attribute attr;
|
||||
const char *name = NULL;
|
||||
|
||||
+ if (recur_count == 100)
|
||||
+ {
|
||||
+ _bfd_error_handler
|
||||
+ (_("DWARF error: abstract instance recursion detected"));
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
/* DW_FORM_ref_addr can reference an entry in a different CU. It
|
||||
is an offset from the .debug_info section, not the current CU. */
|
||||
if (attr_ptr->form == DW_FORM_ref_addr)
|
||||
@@ -2962,15 +2970,7 @@ find_abstract_instance (struct comp_unit
|
||||
info_ptr, info_ptr_end);
|
||||
if (info_ptr == NULL)
|
||||
break;
|
||||
- /* It doesn't ever make sense for DW_AT_specification to
|
||||
- refer to the same DIE. Stop simple recursion. */
|
||||
- if (info_ptr == orig_info_ptr)
|
||||
- {
|
||||
- _bfd_error_handler
|
||||
- (_("DWARF error: abstract instance recursion detected"));
|
||||
- bfd_set_error (bfd_error_bad_value);
|
||||
- return FALSE;
|
||||
- }
|
||||
+
|
||||
switch (attr.name)
|
||||
{
|
||||
case DW_AT_name:
|
||||
@@ -2984,7 +2984,7 @@ find_abstract_instance (struct comp_unit
|
||||
}
|
||||
break;
|
||||
case DW_AT_specification:
|
||||
- if (!find_abstract_instance (unit, info_ptr, &attr,
|
||||
+ if (!find_abstract_instance (unit, &attr, recur_count + 1,
|
||||
&name, is_linkage,
|
||||
filename_ptr, linenumber_ptr))
|
||||
return FALSE;
|
||||
@@ -3200,7 +3200,7 @@ scan_unit_for_symbols (struct comp_unit
|
||||
|
||||
case DW_AT_abstract_origin:
|
||||
case DW_AT_specification:
|
||||
- if (!find_abstract_instance (unit, info_ptr, &attr,
|
||||
+ if (!find_abstract_instance (unit, &attr, 0,
|
||||
&func->name,
|
||||
&func->is_linkage,
|
||||
&func->file,
|
|
@ -1,20 +0,0 @@
|
|||
--- binutils.orig/bfd/dwarf2.c 2019-11-13 11:32:09.395430104 +0000
|
||||
+++ binutils-2.33.1/bfd/dwarf2.c 2019-11-13 11:33:17.272899503 +0000
|
||||
@@ -4440,7 +4440,16 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd,
|
||||
for (total_size = 0;
|
||||
msec;
|
||||
msec = find_debug_info (debug_bfd, debug_sections, msec))
|
||||
- total_size += msec->size;
|
||||
+ {
|
||||
+ /* Catch PR25070 testcase overflowing size calculation here. */
|
||||
+ if (total_size + msec->size < total_size
|
||||
+ || total_size + msec->size < msec->size)
|
||||
+ {
|
||||
+ bfd_set_error (bfd_error_no_memory);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ total_size += msec->size;
|
||||
+ }
|
||||
|
||||
stash->info_ptr_memory = (bfd_byte *) bfd_malloc (total_size);
|
||||
if (stash->info_ptr_memory == NULL)
|
|
@ -0,0 +1,13 @@
|
|||
--- binutils.orig/bfd/elf.c 2022-12-13 15:21:20.040233487 +0000
|
||||
+++ binutils-2.39/bfd/elf.c 2022-12-13 15:22:33.580986232 +0000
|
||||
@@ -8868,7 +8868,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
goto error_return_verref;
|
||||
}
|
||||
- elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) bfd_alloc (abfd, amt);
|
||||
+ if (amt == 0)
|
||||
+ goto error_return_verref;
|
||||
+ elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) bfd_zalloc (abfd, amt);
|
||||
if (elf_tdata (abfd)->verref == NULL)
|
||||
goto error_return_verref;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
--- binutils.orig/binutils/dwarf.c 2022-08-31 11:58:08.918685348 +0100
|
||||
+++ binutils-2.39/binutils/dwarf.c 2022-08-31 15:24:13.881865797 +0100
|
||||
@@ -6365,7 +6365,11 @@ display_debug_abbrev (struct dwarf_secti
|
||||
list->start_of_next_abbrevs = start;
|
||||
}
|
||||
else
|
||||
- start = list->start_of_next_abbrevs;
|
||||
+ {
|
||||
+ if (start == list->start_of_next_abbrevs)
|
||||
+ break;
|
||||
+ start = list->start_of_next_abbrevs;
|
||||
+ }
|
||||
|
||||
if (list->first_abbrev == NULL)
|
||||
continue;
|
|
@ -1,447 +0,0 @@
|
|||
diff -rup binutils.orig/bfd/bfd.c binutils-2.31.1/bfd/bfd.c
|
||||
--- binutils.orig/bfd/bfd.c 2019-02-18 11:53:32.155652114 +0000
|
||||
+++ binutils-2.31.1/bfd/bfd.c 2019-02-18 12:03:21.591459682 +0000
|
||||
@@ -2332,6 +2332,8 @@ bfd_update_compression_header (bfd *abfd
|
||||
bfd_put_32 (abfd, sec->size, &echdr->ch_size);
|
||||
bfd_put_32 (abfd, 1 << sec->alignment_power,
|
||||
&echdr->ch_addralign);
|
||||
+ /* bfd_log2 (alignof (Elf32_Chdr)). */
|
||||
+ bfd_set_section_alignment (abfd, sec, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2342,6 +2344,8 @@ bfd_update_compression_header (bfd *abfd
|
||||
bfd_put_64 (abfd, sec->size, &echdr->ch_size);
|
||||
bfd_put_64 (abfd, 1 << sec->alignment_power,
|
||||
&echdr->ch_addralign);
|
||||
+ /* bfd_log2 (alignof (Elf64_Chdr)). */
|
||||
+ bfd_set_section_alignment (abfd, sec, 3);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2354,6 +2358,8 @@ bfd_update_compression_header (bfd *abfd
|
||||
order. */
|
||||
memcpy (contents, "ZLIB", 4);
|
||||
bfd_putb64 (sec->size, contents + 4);
|
||||
+ /* No way to keep the original alignment, just use 1 always. */
|
||||
+ bfd_set_section_alignment (abfd, sec, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2368,12 +2374,15 @@ bfd_update_compression_header (bfd *abfd
|
||||
SYNOPSIS
|
||||
bfd_boolean bfd_check_compression_header
|
||||
(bfd *abfd, bfd_byte *contents, asection *sec,
|
||||
- bfd_size_type *uncompressed_size);
|
||||
+ bfd_size_type *uncompressed_size,
|
||||
+ unsigned int *uncompressed_alignment_power);
|
||||
+
|
||||
|
||||
DESCRIPTION
|
||||
Check the compression header at CONTENTS of SEC in ABFD and
|
||||
- store the uncompressed size in UNCOMPRESSED_SIZE if the
|
||||
- compression header is valid.
|
||||
+ store the uncompressed size in UNCOMPRESSED_SIZE and the
|
||||
+ uncompressed data alignment in UNCOMPRESSED_ALIGNMENT_POWER
|
||||
+ if the compression header is valid.
|
||||
|
||||
RETURNS
|
||||
Return TRUE if the compression header is valid.
|
||||
@@ -2382,7 +2391,8 @@ RETURNS
|
||||
bfd_boolean
|
||||
bfd_check_compression_header (bfd *abfd, bfd_byte *contents,
|
||||
asection *sec,
|
||||
- bfd_size_type *uncompressed_size)
|
||||
+ bfd_size_type *uncompressed_size,
|
||||
+ unsigned int *uncompressed_alignment_power)
|
||||
{
|
||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
|
||||
&& (elf_section_flags (sec) & SHF_COMPRESSED) != 0)
|
||||
@@ -2404,9 +2414,10 @@ bfd_check_compression_header (bfd *abfd,
|
||||
chdr.ch_addralign = bfd_get_64 (abfd, &echdr->ch_addralign);
|
||||
}
|
||||
if (chdr.ch_type == ELFCOMPRESS_ZLIB
|
||||
- && chdr.ch_addralign == 1U << sec->alignment_power)
|
||||
+ && chdr.ch_addralign == (1U << bfd_log2 (chdr.ch_addralign)))
|
||||
{
|
||||
*uncompressed_size = chdr.ch_size;
|
||||
+ *uncompressed_alignment_power = bfd_log2 (chdr.ch_addralign);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.31.1/bfd/bfd-in2.h
|
||||
--- binutils.orig/bfd/bfd-in2.h 2019-02-18 11:53:32.156652107 +0000
|
||||
+++ binutils-2.31.1/bfd/bfd-in2.h 2019-02-18 12:00:23.849723903 +0000
|
||||
@@ -7274,7 +7274,8 @@ void bfd_update_compression_header
|
||||
|
||||
bfd_boolean bfd_check_compression_header
|
||||
(bfd *abfd, bfd_byte *contents, asection *sec,
|
||||
- bfd_size_type *uncompressed_size);
|
||||
+ bfd_size_type *uncompressed_size,
|
||||
+ unsigned int *uncompressed_alignment_power);
|
||||
|
||||
int bfd_get_compression_header_size (bfd *abfd, asection *sec);
|
||||
|
||||
@@ -7850,7 +7851,8 @@ void bfd_cache_section_contents
|
||||
bfd_boolean bfd_is_section_compressed_with_header
|
||||
(bfd *abfd, asection *section,
|
||||
int *compression_header_size_p,
|
||||
- bfd_size_type *uncompressed_size_p);
|
||||
+ bfd_size_type *uncompressed_size_p,
|
||||
+ unsigned int *uncompressed_alignment_power_p);
|
||||
|
||||
bfd_boolean bfd_is_section_compressed
|
||||
(bfd *abfd, asection *section);
|
||||
diff -rup binutils.orig/bfd/compress.c binutils-2.31.1/bfd/compress.c
|
||||
--- binutils.orig/bfd/compress.c 2019-02-18 11:53:32.153652128 +0000
|
||||
+++ binutils-2.31.1/bfd/compress.c 2019-02-18 12:11:44.899886376 +0000
|
||||
@@ -84,11 +84,13 @@ bfd_compress_section_contents (bfd *abfd
|
||||
int zlib_size = 0;
|
||||
int orig_compression_header_size;
|
||||
bfd_size_type orig_uncompressed_size;
|
||||
+ unsigned int orig_uncompressed_alignment_pow;
|
||||
int header_size = bfd_get_compression_header_size (abfd, NULL);
|
||||
bfd_boolean compressed
|
||||
= bfd_is_section_compressed_with_header (abfd, sec,
|
||||
&orig_compression_header_size,
|
||||
- &orig_uncompressed_size);
|
||||
+ &orig_uncompressed_size,
|
||||
+ &orig_uncompressed_alignment_pow);
|
||||
|
||||
/* Either ELF compression header or the 12-byte, "ZLIB" + 8-byte size,
|
||||
overhead in .zdebug* section. */
|
||||
@@ -153,6 +155,8 @@ bfd_compress_section_contents (bfd *abfd
|
||||
return 0;
|
||||
}
|
||||
free (uncompressed_buffer);
|
||||
+ bfd_set_section_alignment (abfd, sec,
|
||||
+ orig_uncompressed_alignment_pow);
|
||||
sec->contents = buffer;
|
||||
sec->compress_status = COMPRESS_SECTION_DONE;
|
||||
return orig_uncompressed_size;
|
||||
@@ -364,20 +368,25 @@ SYNOPSIS
|
||||
bfd_boolean bfd_is_section_compressed_with_header
|
||||
(bfd *abfd, asection *section,
|
||||
int *compression_header_size_p,
|
||||
- bfd_size_type *uncompressed_size_p);
|
||||
+ bfd_size_type *uncompressed_size_p,
|
||||
+ unsigned int *uncompressed_alignment_power_p);
|
||||
+
|
||||
|
||||
DESCRIPTION
|
||||
Return @code{TRUE} if @var{section} is compressed. Compression
|
||||
- header size is returned in @var{compression_header_size_p} and
|
||||
- uncompressed size is returned in @var{uncompressed_size_p}. If
|
||||
- compression is unsupported, compression header size is returned
|
||||
- with -1 and uncompressed size is returned with 0.
|
||||
+ header size is returned in @var{compression_header_size_p},
|
||||
+ uncompressed size is returned in @var{uncompressed_size_p}
|
||||
+ and the uncompressed data alignement power is returned in
|
||||
+ @var{uncompressed_align_pow_p}. If compression is
|
||||
+ unsupported, compression header size is returned with -1
|
||||
+ and uncompressed size is returned with 0.
|
||||
*/
|
||||
|
||||
bfd_boolean
|
||||
bfd_is_section_compressed_with_header (bfd *abfd, sec_ptr sec,
|
||||
int *compression_header_size_p,
|
||||
- bfd_size_type *uncompressed_size_p)
|
||||
+ bfd_size_type *uncompressed_size_p,
|
||||
+ unsigned int *uncompressed_align_pow_p)
|
||||
{
|
||||
bfd_byte header[MAX_COMPRESSION_HEADER_SIZE];
|
||||
int compression_header_size;
|
||||
@@ -385,6 +394,8 @@ bfd_is_section_compressed_with_header (b
|
||||
unsigned int saved = sec->compress_status;
|
||||
bfd_boolean compressed;
|
||||
|
||||
+ *uncompressed_align_pow_p = 0;
|
||||
+
|
||||
compression_header_size = bfd_get_compression_header_size (abfd, sec);
|
||||
if (compression_header_size > MAX_COMPRESSION_HEADER_SIZE)
|
||||
abort ();
|
||||
@@ -412,7 +423,8 @@ bfd_is_section_compressed_with_header (b
|
||||
if (compression_header_size != 0)
|
||||
{
|
||||
if (!bfd_check_compression_header (abfd, header, sec,
|
||||
- uncompressed_size_p))
|
||||
+ uncompressed_size_p,
|
||||
+ uncompressed_align_pow_p))
|
||||
compression_header_size = -1;
|
||||
}
|
||||
/* Check for the pathalogical case of a debug string section that
|
||||
@@ -449,9 +461,11 @@ bfd_is_section_compressed (bfd *abfd, se
|
||||
{
|
||||
int compression_header_size;
|
||||
bfd_size_type uncompressed_size;
|
||||
+ unsigned int uncompressed_align_power;
|
||||
return (bfd_is_section_compressed_with_header (abfd, sec,
|
||||
&compression_header_size,
|
||||
- &uncompressed_size)
|
||||
+ &uncompressed_size,
|
||||
+ &uncompressed_align_power)
|
||||
&& compression_header_size >= 0
|
||||
&& uncompressed_size > 0);
|
||||
}
|
||||
@@ -480,6 +494,7 @@ bfd_init_section_decompress_status (bfd
|
||||
int compression_header_size;
|
||||
int header_size;
|
||||
bfd_size_type uncompressed_size;
|
||||
+ unsigned int uncompressed_alignment_power = 0;
|
||||
|
||||
compression_header_size = bfd_get_compression_header_size (abfd, sec);
|
||||
if (compression_header_size > MAX_COMPRESSION_HEADER_SIZE)
|
||||
@@ -508,7 +523,8 @@ bfd_init_section_decompress_status (bfd
|
||||
uncompressed_size = bfd_getb64 (header + 4);
|
||||
}
|
||||
else if (!bfd_check_compression_header (abfd, header, sec,
|
||||
- &uncompressed_size))
|
||||
+ &uncompressed_size,
|
||||
+ &uncompressed_alignment_power))
|
||||
{
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return FALSE;
|
||||
@@ -516,6 +532,7 @@ bfd_init_section_decompress_status (bfd
|
||||
|
||||
sec->compressed_size = sec->size;
|
||||
sec->size = uncompressed_size;
|
||||
+ bfd_set_section_alignment (abfd, sec, uncompressed_alignment_power);
|
||||
sec->compress_status = DECOMPRESS_SECTION_SIZED;
|
||||
|
||||
return TRUE;
|
||||
diff -rup binutils.orig/bfd/elf.c binutils-2.31.1/bfd/elf.c
|
||||
--- binutils.orig/bfd/elf.c 2019-02-18 11:53:32.161652071 +0000
|
||||
+++ binutils-2.31.1/bfd/elf.c 2019-02-18 12:08:52.135108638 +0000
|
||||
@@ -1177,10 +1177,12 @@ _bfd_elf_make_section_from_shdr (bfd *ab
|
||||
enum { nothing, compress, decompress } action = nothing;
|
||||
int compression_header_size;
|
||||
bfd_size_type uncompressed_size;
|
||||
+ unsigned int uncompressed_align_power;
|
||||
bfd_boolean compressed
|
||||
= bfd_is_section_compressed_with_header (abfd, newsect,
|
||||
&compression_header_size,
|
||||
- &uncompressed_size);
|
||||
+ &uncompressed_size,
|
||||
+ &uncompressed_align_power);
|
||||
|
||||
if (compressed)
|
||||
{
|
||||
diff -rup binutils.orig/binutils/readelf.c binutils-2.31.1/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2019-02-18 11:53:32.947646480 +0000
|
||||
+++ binutils-2.31.1/binutils/readelf.c 2019-02-18 12:10:13.142535034 +0000
|
||||
@@ -13366,12 +13366,6 @@ dump_section_as_strings (Elf_Internal_Sh
|
||||
printable_section_name (filedata, section), chdr.ch_type);
|
||||
return FALSE;
|
||||
}
|
||||
- else if (chdr.ch_addralign != section->sh_addralign)
|
||||
- {
|
||||
- warn (_("compressed section '%s' is corrupted\n"),
|
||||
- printable_section_name (filedata, section));
|
||||
- return FALSE;
|
||||
- }
|
||||
uncompressed_size = chdr.ch_size;
|
||||
start += compression_header_size;
|
||||
new_size -= compression_header_size;
|
||||
@@ -13513,12 +13507,6 @@ dump_section_as_bytes (Elf_Internal_Shdr
|
||||
printable_section_name (filedata, section), chdr.ch_type);
|
||||
return FALSE;
|
||||
}
|
||||
- else if (chdr.ch_addralign != section->sh_addralign)
|
||||
- {
|
||||
- warn (_("compressed section '%s' is corrupted\n"),
|
||||
- printable_section_name (filedata, section));
|
||||
- return FALSE;
|
||||
- }
|
||||
uncompressed_size = chdr.ch_size;
|
||||
start += compression_header_size;
|
||||
new_size -= compression_header_size;
|
||||
@@ -13688,12 +13676,6 @@ load_specific_debug_section (enum dwarf_
|
||||
section->name, chdr.ch_type);
|
||||
return FALSE;
|
||||
}
|
||||
- else if (chdr.ch_addralign != sec->sh_addralign)
|
||||
- {
|
||||
- warn (_("compressed section '%s' is corrupted\n"),
|
||||
- section->name);
|
||||
- return FALSE;
|
||||
- }
|
||||
uncompressed_size = chdr.ch_size;
|
||||
start += compression_header_size;
|
||||
size -= compression_header_size;
|
||||
diff -rup binutils.orig/binutils/testsuite/binutils-all/dw2-3.rS binutils-2.31.1/binutils/testsuite/binutils-all/dw2-3.rS
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/dw2-3.rS 2019-02-18 11:53:32.908646758 +0000
|
||||
+++ binutils-2.31.1/binutils/testsuite/binutils-all/dw2-3.rS 2019-02-18 12:10:40.884338917 +0000
|
||||
@@ -1,3 +1,3 @@
|
||||
#...
|
||||
- +\[[ 0-9]+\] .debug_info +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +C +0 +0 +1
|
||||
+ +\[[ 0-9]+\] .debug_info +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +C +0 +0 +(4|8)
|
||||
#pass
|
||||
diff -rup binutils.orig/binutils/testsuite/binutils-all/dw2-3.rt binutils-2.31.1/binutils/testsuite/binutils-all/dw2-3.rt
|
||||
--- binutils.orig/binutils/testsuite/binutils-all/dw2-3.rt 2019-02-18 11:53:32.905646779 +0000
|
||||
+++ binutils-2.31.1/binutils/testsuite/binutils-all/dw2-3.rt 2019-02-18 12:11:13.476108521 +0000
|
||||
@@ -1,6 +1,6 @@
|
||||
#...
|
||||
+\[[ 0-9]+\] .debug_info
|
||||
- +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +0 +0 +1
|
||||
+ +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +0 +0 +(4|8)
|
||||
+\[0+800\]: COMPRESSED
|
||||
+ZLIB, 0+9d, 1
|
||||
#pass
|
||||
diff -rup binutils.orig/gold/merge.cc binutils-2.31.1/gold/merge.cc
|
||||
--- binutils.orig/gold/merge.cc 2019-02-18 11:53:32.210651723 +0000
|
||||
+++ binutils-2.31.1/gold/merge.cc 2019-02-18 12:12:59.027362334 +0000
|
||||
@@ -440,9 +440,11 @@ Output_merge_string<Char_type>::do_add_i
|
||||
{
|
||||
section_size_type sec_len;
|
||||
bool is_new;
|
||||
+ uint64_t addralign = this->addralign();
|
||||
const unsigned char* pdata = object->decompressed_section_contents(shndx,
|
||||
&sec_len,
|
||||
- &is_new);
|
||||
+ &is_new,
|
||||
+ &addralign);
|
||||
|
||||
const Char_type* p = reinterpret_cast<const Char_type*>(pdata);
|
||||
const Char_type* pend = p + sec_len / sizeof(Char_type);
|
||||
@@ -494,7 +496,7 @@ Output_merge_string<Char_type>::do_add_i
|
||||
// aligned, so each string within the section must retain the same
|
||||
// modulo.
|
||||
uintptr_t init_align_modulo = (reinterpret_cast<uintptr_t>(pdata)
|
||||
- & (this->addralign() - 1));
|
||||
+ & (addralign - 1));
|
||||
bool has_misaligned_strings = false;
|
||||
|
||||
while (p < pend)
|
||||
@@ -503,7 +505,7 @@ Output_merge_string<Char_type>::do_add_i
|
||||
|
||||
// Within merge input section each string must be aligned.
|
||||
if (len != 0
|
||||
- && ((reinterpret_cast<uintptr_t>(p) & (this->addralign() - 1))
|
||||
+ && ((reinterpret_cast<uintptr_t>(p) & (addralign - 1))
|
||||
!= init_align_modulo))
|
||||
has_misaligned_strings = true;
|
||||
|
||||
diff -rup binutils.orig/gold/object.cc binutils-2.31.1/gold/object.cc
|
||||
--- binutils.orig/gold/object.cc 2019-02-18 11:53:32.208651737 +0000
|
||||
+++ binutils-2.31.1/gold/object.cc 2019-02-18 12:16:35.938828914 +0000
|
||||
@@ -751,11 +751,13 @@ build_compressed_section_map(
|
||||
const unsigned char* contents =
|
||||
obj->section_contents(i, &len, false);
|
||||
uint64_t uncompressed_size;
|
||||
+ Compressed_section_info info;
|
||||
if (is_zcompressed)
|
||||
{
|
||||
// Skip over the ".zdebug" prefix.
|
||||
name += 7;
|
||||
uncompressed_size = get_uncompressed_size(contents, len);
|
||||
+ info.addralign = shdr.get_sh_addralign();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -763,8 +765,8 @@ build_compressed_section_map(
|
||||
name += 6;
|
||||
elfcpp::Chdr<size, big_endian> chdr(contents);
|
||||
uncompressed_size = chdr.get_ch_size();
|
||||
+ info.addralign = chdr.get_ch_addralign();
|
||||
}
|
||||
- Compressed_section_info info;
|
||||
info.size = convert_to_section_size_type(uncompressed_size);
|
||||
info.flag = shdr.get_sh_flags();
|
||||
info.contents = NULL;
|
||||
@@ -3060,7 +3062,8 @@ const unsigned char*
|
||||
Object::decompressed_section_contents(
|
||||
unsigned int shndx,
|
||||
section_size_type* plen,
|
||||
- bool* is_new)
|
||||
+ bool* is_new,
|
||||
+ uint64_t* palign)
|
||||
{
|
||||
section_size_type buffer_size;
|
||||
const unsigned char* buffer = this->do_section_contents(shndx, &buffer_size,
|
||||
@@ -3087,6 +3090,8 @@ Object::decompressed_section_contents(
|
||||
{
|
||||
*plen = uncompressed_size;
|
||||
*is_new = false;
|
||||
+ if (palign != NULL)
|
||||
+ *palign = p->second.addralign;
|
||||
return p->second.contents;
|
||||
}
|
||||
|
||||
@@ -3108,6 +3113,8 @@ Object::decompressed_section_contents(
|
||||
// once in this pass.
|
||||
*plen = uncompressed_size;
|
||||
*is_new = true;
|
||||
+ if (palign != NULL)
|
||||
+ *palign = p->second.addralign;
|
||||
return uncompressed_data;
|
||||
}
|
||||
|
||||
diff -rup binutils.orig/gold/object.h binutils-2.31.1/gold/object.h
|
||||
--- binutils.orig/gold/object.h 2019-02-18 11:53:32.210651723 +0000
|
||||
+++ binutils-2.31.1/gold/object.h 2019-02-18 12:17:50.625300926 +0000
|
||||
@@ -373,6 +373,7 @@ struct Compressed_section_info
|
||||
{
|
||||
section_size_type size;
|
||||
elfcpp::Elf_Xword flag;
|
||||
+ uint64_t addralign;
|
||||
const unsigned char* contents;
|
||||
};
|
||||
typedef std::map<unsigned int, Compressed_section_info> Compressed_section_map;
|
||||
@@ -808,7 +809,8 @@ class Object
|
||||
|
||||
bool
|
||||
section_is_compressed(unsigned int shndx,
|
||||
- section_size_type* uncompressed_size) const
|
||||
+ section_size_type* uncompressed_size,
|
||||
+ elfcpp::Elf_Xword* palign = NULL) const
|
||||
{
|
||||
if (this->compressed_sections_ == NULL)
|
||||
return false;
|
||||
@@ -818,6 +820,8 @@ class Object
|
||||
{
|
||||
if (uncompressed_size != NULL)
|
||||
*uncompressed_size = p->second.size;
|
||||
+ if (palign != NULL)
|
||||
+ *palign = p->second.addralign;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -828,7 +832,7 @@ class Object
|
||||
// by the caller.
|
||||
const unsigned char*
|
||||
decompressed_section_contents(unsigned int shndx, section_size_type* plen,
|
||||
- bool* is_cached);
|
||||
+ bool* is_cached, uint64_t* palign = NULL);
|
||||
|
||||
// Discard any buffers of decompressed sections. This is done
|
||||
// at the end of the Add_symbols task.
|
||||
diff -rup binutils.orig/gold/output.cc binutils-2.31.1/gold/output.cc
|
||||
--- binutils.orig/gold/output.cc 2019-02-18 11:53:32.209651729 +0000
|
||||
+++ binutils-2.31.1/gold/output.cc 2019-02-18 12:18:39.729953797 +0000
|
||||
@@ -2448,7 +2448,14 @@ Output_section::add_input_section(Layout
|
||||
unsigned int reloc_shndx,
|
||||
bool have_sections_script)
|
||||
{
|
||||
+ section_size_type input_section_size = shdr.get_sh_size();
|
||||
+ section_size_type uncompressed_size;
|
||||
elfcpp::Elf_Xword addralign = shdr.get_sh_addralign();
|
||||
+
|
||||
+ if (object->section_is_compressed(shndx, &uncompressed_size,
|
||||
+ &addralign))
|
||||
+ input_section_size = uncompressed_size;
|
||||
+
|
||||
if ((addralign & (addralign - 1)) != 0)
|
||||
{
|
||||
object->error(_("invalid alignment %lu for section \"%s\""),
|
||||
@@ -2498,11 +2505,6 @@ Output_section::add_input_section(Layout
|
||||
}
|
||||
}
|
||||
|
||||
- section_size_type input_section_size = shdr.get_sh_size();
|
||||
- section_size_type uncompressed_size;
|
||||
- if (object->section_is_compressed(shndx, &uncompressed_size))
|
||||
- input_section_size = uncompressed_size;
|
||||
-
|
||||
off_t offset_in_section;
|
||||
|
||||
if (this->has_fixed_layout())
|
|
@ -1,68 +0,0 @@
|
|||
diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.30/gas/config/obj-elf.c
|
||||
--- binutils.orig/gas/config/obj-elf.c 2018-09-24 17:50:06.974172867 +0100
|
||||
+++ binutils-2.30/gas/config/obj-elf.c 2018-09-25 15:19:33.559830794 +0100
|
||||
@@ -82,9 +82,11 @@ static void obj_elf_gnu_attribute (int);
|
||||
static void obj_elf_tls_common (int);
|
||||
static void obj_elf_lcomm (int);
|
||||
static void obj_elf_struct (int);
|
||||
+static void obj_elf_attach_to_group (int);
|
||||
|
||||
static const pseudo_typeS elf_pseudo_table[] =
|
||||
{
|
||||
+ {"attach_to_group", obj_elf_attach_to_group, 0},
|
||||
{"comm", obj_elf_common, 0},
|
||||
{"common", obj_elf_common, 1},
|
||||
{"ident", obj_elf_ident, 0},
|
||||
@@ -1007,6 +1009,27 @@ obj_elf_section_name (void)
|
||||
return name;
|
||||
}
|
||||
|
||||
+static void
|
||||
+obj_elf_attach_to_group (int dummy ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ const char * gname = obj_elf_section_name ();
|
||||
+
|
||||
+ if (gname == NULL)
|
||||
+ {
|
||||
+ as_warn ("group name not parseable");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (elf_group_name (now_seg))
|
||||
+ {
|
||||
+ as_warn ("already has a group");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ elf_group_name (now_seg) = xstrdup (gname);
|
||||
+ elf_section_flags (now_seg) |= SHF_GROUP;
|
||||
+}
|
||||
+
|
||||
void
|
||||
obj_elf_section (int push)
|
||||
{
|
||||
diff -rup binutils.orig/gas/doc/as.texinfo binutils-2.30/gas/doc/as.texinfo
|
||||
--- binutils.orig/gas/doc/as.texi 2018-09-24 17:50:06.984172788 +0100
|
||||
+++ binutils-2.30/gas/doc/as.texi 2018-09-25 15:19:43.557748972 +0100
|
||||
@@ -4407,6 +4407,7 @@ Some machine configurations provide addi
|
||||
* Altmacro:: @code{.altmacro}
|
||||
* Ascii:: @code{.ascii "@var{string}"}@dots{}
|
||||
* Asciz:: @code{.asciz "@var{string}"}@dots{}
|
||||
+* Attach_to_group:: @code{.attach_to_group @var{name}}
|
||||
* Balign:: @code{.balign @var{abs-expr} , @var{abs-expr}}
|
||||
* Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc
|
||||
* Byte:: @code{.byte @var{expressions}}
|
||||
@@ -4703,6 +4704,12 @@ trailing zero byte) into consecutive add
|
||||
@code{.asciz} is just like @code{.ascii}, but each string is followed by
|
||||
a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
|
||||
|
||||
+@node Attach_to_group
|
||||
+@section @code{.attach_to_group @var{name}}
|
||||
+Attaches the current section to the named group. This is like declaring
|
||||
+the section with the @code{G} attribute, but can be done after the section
|
||||
+has been created.
|
||||
+
|
||||
@node Balign
|
||||
@section @code{.balign[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
--- binutils.orig/config/override.m4 2021-08-31 14:20:17.275574804 +0100
|
||||
+++ binutils-2.37/config/override.m4 2021-08-31 14:36:37.793954247 +0100
|
||||
@@ -41,7 +41,7 @@ dnl Or for updating the whole tree at on
|
||||
AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
|
||||
[m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
|
||||
m4_defn([m4_PACKAGE_VERSION]), [],
|
||||
- [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
|
||||
+ [])
|
||||
])
|
||||
m4_define([AC_INIT], m4_defn([AC_INIT])[
|
||||
_GCC_AUTOCONF_VERSION_CHECK
|
|
@ -0,0 +1,11 @@
|
|||
--- binutils-2.39/ld/testsuite/ld-elfvers/vers.exp 2023-10-30 13:08:25.863377518 +0000
|
||||
+++ binutils.orig/ld/testsuite/ld-elfvers/vers.exp 2023-10-30 13:05:18.094268608 +0000
|
||||
@@ -109,7 +109,7 @@ proc test_ar { test lib object expect }
|
||||
return
|
||||
}
|
||||
|
||||
- set cmd "$nm --print-armap $tmpdir/$lib | grep \\\ in\\\ | egrep VERS\\\|bar\\\|foo | grep -v ^\\\\. | sort > $tmpdir/nm.out"
|
||||
+ set cmd "$nm --print-armap $tmpdir/$lib | grep \\\ in\\\ | grep -E VERS\\\|bar\\\|foo | grep -v ^\\\\. | sort > $tmpdir/nm.out"
|
||||
verbose -log $cmd
|
||||
catch "exec $cmd" exec_output
|
||||
if [string match "" $exec_output] then {
|
|
@ -5,8 +5,8 @@ diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am
|
|||
bfdincludedir = @bfdincludedir@
|
||||
bfdlib_LTLIBRARIES = libbfd.la
|
||||
bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
- bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
else !INSTALL_LIBBFD
|
||||
# Empty these so that the respective installation directories will not be created.
|
||||
bfdlibdir =
|
||||
|
@ -16,7 +16,7 @@ diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
|
|||
@@ -249,7 +249,7 @@ am__can_run_installinfo = \
|
||||
esac
|
||||
am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
|
||||
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bfd_stdint.h \
|
||||
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h
|
||||
+ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
|
||||
HEADERS = $(bfdinclude_HEADERS)
|
||||
|
@ -26,8 +26,8 @@ diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in
|
|||
@INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
|
||||
@INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
|
||||
-@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h \
|
||||
+@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \
|
||||
-@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h \
|
||||
+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \
|
||||
@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
|
||||
@INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
|
||||
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
--- binutils.orig/binutils/readelf.c 2018-01-22 15:48:10.450701702 +0000
|
||||
+++ binutils-2.30.0/binutils/readelf.c 2018-01-22 15:55:26.739588657 +0000
|
||||
@@ -19019,75 +19019,85 @@ process_file (char * file_name)
|
||||
Filedata * filedata = NULL;
|
||||
--- binutils.orig/binutils/readelf.c 2021-07-19 12:39:14.206556025 +0100
|
||||
+++ binutils-2.37/binutils/readelf.c 2021-07-19 12:44:37.712728732 +0100
|
||||
@@ -21873,45 +21873,52 @@ process_file (char * file_name)
|
||||
struct stat statbuf;
|
||||
char armag[SARMAG];
|
||||
- bfd_boolean ret = TRUE;
|
||||
+ bfd_boolean ret = FALSE;
|
||||
bool ret = true;
|
||||
+ char * name;
|
||||
+ char * saved_program_name;
|
||||
+
|
||||
|
@ -25,7 +23,7 @@
|
|||
else
|
||||
- error (_("Could not locate '%s'. System error message: %s\n"),
|
||||
- file_name, strerror (errno));
|
||||
- return FALSE;
|
||||
- return false;
|
||||
+ error (_("Could not locate file. System error message: %s\n"),
|
||||
+ strerror (errno));
|
||||
+ goto done;
|
||||
|
@ -34,7 +32,7 @@
|
|||
if (! S_ISREG (statbuf.st_mode))
|
||||
{
|
||||
- error (_("'%s' is not an ordinary file\n"), file_name);
|
||||
- return FALSE;
|
||||
- return false;
|
||||
+ error (_("Not an ordinary file\n"));
|
||||
+ goto done;
|
||||
}
|
||||
|
@ -43,7 +41,7 @@
|
|||
if (filedata == NULL)
|
||||
{
|
||||
error (_("Out of memory allocating file data structure\n"));
|
||||
- return FALSE;
|
||||
- return false;
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
|
@ -53,7 +51,7 @@
|
|||
{
|
||||
- error (_("Input file '%s' is not readable.\n"), file_name);
|
||||
- free (filedata);
|
||||
- return FALSE;
|
||||
- return false;
|
||||
+ error (_("Not readable\n"));
|
||||
+ goto done;
|
||||
}
|
||||
|
@ -63,62 +61,74 @@
|
|||
- error (_("%s: Failed to read file's magic number\n"), file_name);
|
||||
- fclose (filedata->handle);
|
||||
- free (filedata);
|
||||
- return FALSE;
|
||||
- }
|
||||
-
|
||||
- filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
-
|
||||
- if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||
- {
|
||||
- if (! process_archive (filedata, FALSE))
|
||||
- ret = FALSE;
|
||||
- }
|
||||
- else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||
- {
|
||||
- if ( ! process_archive (filedata, TRUE))
|
||||
- ret = FALSE;
|
||||
- return false;
|
||||
+ error (_("Failed to read file's magic number\n"));
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
@@ -21919,33 +21926,39 @@ process_file (char * file_name)
|
||||
|
||||
if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||
{
|
||||
- if (! process_archive (filedata, false))
|
||||
- ret = false;
|
||||
+ if (process_archive (filedata, false))
|
||||
+ ret = true;
|
||||
}
|
||||
else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||
{
|
||||
- if ( ! process_archive (filedata, true))
|
||||
- ret = false;
|
||||
+ if (process_archive (filedata, true))
|
||||
+ ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (do_archive_index)
|
||||
if (do_archive_index && !check_all)
|
||||
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
|
||||
- file_name);
|
||||
+ filedata->file_size = (bfd_size_type) statbuf.st_size;
|
||||
+ error (_("Not an archive so its index cannot be displayed.\n"));
|
||||
|
||||
rewind (filedata->handle);
|
||||
filedata->archive_file_size = filedata->archive_file_offset = 0;
|
||||
|
||||
- rewind (filedata->handle);
|
||||
- archive_file_size = archive_file_offset = 0;
|
||||
-
|
||||
- if (! process_object (filedata))
|
||||
- ret = FALSE;
|
||||
+ if (memcmp (armag, ARMAG, SARMAG) == 0)
|
||||
+ {
|
||||
+ if (process_archive (filedata, FALSE))
|
||||
+ ret = TRUE;
|
||||
+ }
|
||||
+ else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
||||
+ {
|
||||
+ if (process_archive (filedata, TRUE))
|
||||
+ ret = TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (do_archive_index)
|
||||
+ error (_("Not an archive so its index cannot be displayed.\n"));
|
||||
+
|
||||
+ rewind (filedata->handle);
|
||||
+ archive_file_size = archive_file_offset = 0;
|
||||
+
|
||||
+ if (process_object (filedata))
|
||||
+ ret = TRUE;
|
||||
+ }
|
||||
- ret = false;
|
||||
+ if (process_object (filedata))
|
||||
+ ret = true;
|
||||
}
|
||||
|
||||
fclose (filedata->handle);
|
||||
- fclose (filedata->handle);
|
||||
- free (filedata->section_headers);
|
||||
- free (filedata->program_headers);
|
||||
- free (filedata->string_table);
|
||||
- free (filedata->dump.dump_sects);
|
||||
- free (filedata);
|
||||
+ done:
|
||||
free (filedata);
|
||||
+ if (filedata)
|
||||
+ {
|
||||
+ if (filedata->handle != NULL)
|
||||
+ fclose (filedata->handle);
|
||||
+ free (filedata->section_headers);
|
||||
+ free (filedata->program_headers);
|
||||
+ free (filedata->string_table);
|
||||
+ free (filedata->dump.dump_sects);
|
||||
+ free (filedata);
|
||||
+ }
|
||||
+ free (program_name);
|
||||
+ program_name = saved_program_name;
|
||||
|
||||
return ret;
|
||||
}
|
||||
free (ba_cache.strtab);
|
||||
ba_cache.strtab = NULL;
|
||||
--- binutils.orig/binutils/readelf.c 2021-08-10 10:15:22.088016072 +0100
|
||||
+++ binutils-2.37/binutils/readelf.c 2021-08-10 10:15:55.567907891 +0100
|
||||
@@ -21884,7 +21884,7 @@ process_file (char * file_name)
|
||||
Filedata * filedata = NULL;
|
||||
struct stat statbuf;
|
||||
char armag[SARMAG];
|
||||
- bool ret = true;
|
||||
+ bool ret = false;
|
||||
char * name;
|
||||
char * saved_program_name;
|
||||
|
|
@ -223,35 +223,6 @@ diff -rup binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp binutils-2.32/ld/test
|
|||
proc srec_off { l } {
|
||||
if [string match "S1*" $l] {
|
||||
return 8
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-x86-64/x86-64.exp 2019-02-15 13:33:22.030626874 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-x86-64/x86-64.exp 2019-02-15 13:57:34.295106041 +0000
|
||||
@@ -1275,25 +1275,6 @@ if { [isnative] && [which $CC] != 0 } {
|
||||
"$NOPIE_CFLAGS" \
|
||||
] \
|
||||
]
|
||||
- } else {
|
||||
- run_cc_link_tests [list \
|
||||
- [list \
|
||||
- "Build pr22001-1b" \
|
||||
- "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
|
||||
- "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { pr22001-1c.c } \
|
||||
- {{error_output "pr22001-1b.err"}} \
|
||||
- "pr22001-1b" \
|
||||
- ] \
|
||||
- [list \
|
||||
- "Build pr21997-1b" \
|
||||
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
|
||||
- "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
|
||||
- { pr21997-1c.c } \
|
||||
- {{error_output "pr21997-1b.err"}} \
|
||||
- "pr21997-1b" \
|
||||
- ] \
|
||||
- ]
|
||||
}
|
||||
|
||||
run_ld_link_exec_tests [list \
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:10:59.038709514 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:13:53.532300721 +0000
|
||||
|
@ -326,3 +297,34 @@ diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/
|
|||
Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY
|
||||
#...
|
||||
hook called: cleanup.
|
||||
diff -rup binutils.orig/ld/testsuite/ld-elfvers/vers24.rd binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd
|
||||
--- binutils.orig/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 09:45:44.013108697 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 12:06:17.287425232 +0100
|
||||
@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e
|
||||
# And ensure the dynamic symbol table contains at least x@VERS.0
|
||||
# and foo@@VERS.0 symbols
|
||||
#...
|
||||
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
|
||||
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
|
||||
#...
|
||||
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0
|
||||
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.*
|
||||
#...
|
||||
Symbol table '.symtab' contains [0-9]+ entries:
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.30/ld/testsuite/ld-plugin/plugin.exp
|
||||
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 09:45:44.023108605 +0100
|
||||
+++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 11:18:53.997202105 +0100
|
||||
@@ -118,6 +118,12 @@ if { $can_compile && !$failed_compile }
|
||||
}
|
||||
}
|
||||
|
||||
+# I do not know why, but the underscore prefix test is going
|
||||
+# wrong on ppc64le targets. So override it here.
|
||||
+if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } {
|
||||
+ set _ ""
|
||||
+}
|
||||
+
|
||||
set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o"
|
||||
set testobjfiles_notext "tmpdir/main.o tmpdir/func.o"
|
||||
set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o"
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
From b53c44bfe31fb036f212275b6d70edd5eee7b088 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Beulich via Binutils <binutils@sourceware.org>
|
||||
Date: Tue, 9 Aug 2022 13:12:03 +0200
|
||||
Subject: [PATCH] gas/Dwarf: properly skip zero-size functions
|
||||
|
||||
PR gas/29451
|
||||
|
||||
While out_debug_abbrev() properly skips such functions, out_debug_info()
|
||||
mistakenly didn't. It needs to calculate the high_pc expression ahead of
|
||||
time, in order to skip emitting any data for the function if the value
|
||||
is zero.
|
||||
|
||||
The one case which would still leave a zero-size entry is when
|
||||
symbol_get_obj(symp)->size ends up evaluating to zero. I hope we can
|
||||
expect that to not be the case, otherwise we'd need to have a way to
|
||||
post-process .debug_info contents between resolving expressions and
|
||||
actually writing the data out to the file. Even then it wouldn't be
|
||||
entirely obvious in which way to alter the data.
|
||||
---
|
||||
gas/dwarf2dbg.c | 39 ++++++++++++++++++++-------------------
|
||||
1 file changed, 20 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
|
||||
index 868ec79ee2c..f346bd6a412 100644
|
||||
--- a/gas/dwarf2dbg.c
|
||||
+++ b/gas/dwarf2dbg.c
|
||||
@@ -2882,6 +2882,7 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT str_seg,
|
||||
{
|
||||
const char *name;
|
||||
size_t len;
|
||||
+ expressionS size = { .X_op = O_constant };
|
||||
|
||||
/* Skip warning constructs (see above). */
|
||||
if (symbol_get_bfdsym (symp)->flags & BSF_WARNING)
|
||||
@@ -2895,6 +2896,18 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT str_seg,
|
||||
if (!S_IS_DEFINED (symp) || !S_IS_FUNCTION (symp))
|
||||
continue;
|
||||
|
||||
+#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */
|
||||
+ size.X_add_number = S_GET_SIZE (symp);
|
||||
+ if (size.X_add_number == 0 && IS_ELF
|
||||
+ && symbol_get_obj (symp)->size != NULL)
|
||||
+ {
|
||||
+ size.X_op = O_add;
|
||||
+ size.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size);
|
||||
+ }
|
||||
+#endif
|
||||
+ if (size.X_op == O_constant && size.X_add_number == 0)
|
||||
+ continue;
|
||||
+
|
||||
subseg_set (str_seg, 0);
|
||||
name_sym = symbol_temp_new_now_octets ();
|
||||
name = S_GET_NAME (symp);
|
||||
@@ -2920,29 +2933,17 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT str_seg,
|
||||
emit_expr (&exp, sizeof_address);
|
||||
|
||||
/* DW_AT_high_pc */
|
||||
- exp.X_op = O_constant;
|
||||
-#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */
|
||||
- exp.X_add_number = S_GET_SIZE (symp);
|
||||
- if (exp.X_add_number == 0 && IS_ELF
|
||||
- && symbol_get_obj (symp)->size != NULL)
|
||||
- {
|
||||
- exp.X_op = O_add;
|
||||
- exp.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size);
|
||||
- }
|
||||
-#else
|
||||
- exp.X_add_number = 0;
|
||||
-#endif
|
||||
if (DWARF2_VERSION < 4)
|
||||
{
|
||||
- if (exp.X_op == O_constant)
|
||||
- exp.X_op = O_symbol;
|
||||
- exp.X_add_symbol = symp;
|
||||
- emit_expr (&exp, sizeof_address);
|
||||
+ if (size.X_op == O_constant)
|
||||
+ size.X_op = O_symbol;
|
||||
+ size.X_add_symbol = symp;
|
||||
+ emit_expr (&size, sizeof_address);
|
||||
}
|
||||
- else if (exp.X_op == O_constant)
|
||||
- out_uleb128 (exp.X_add_number);
|
||||
+ else if (size.X_op == O_constant)
|
||||
+ out_uleb128 (size.X_add_number);
|
||||
else
|
||||
- emit_leb128_expr (symbol_get_value_expression (exp.X_op_symbol), 0);
|
||||
+ emit_leb128_expr (symbol_get_value_expression (size.X_op_symbol), 0);
|
||||
}
|
||||
|
||||
/* End of children. */
|
||||
--
|
||||
2.37.1
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
diff -rup binutils.orig/gold/gdb-index.cc binutils-2.34.0/gold/gdb-index.cc
|
||||
--- binutils.orig/gold/gdb-index.cc 2020-07-24 09:12:29.241306445 +0100
|
||||
+++ binutils-2.34.0/gold/gdb-index.cc 2020-07-24 09:15:48.332095898 +0100
|
||||
@@ -817,7 +817,7 @@ Gdb_index_info_reader::get_qualified_nam
|
||||
void
|
||||
Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die)
|
||||
{
|
||||
- unsigned int shndx;
|
||||
+ unsigned int shndx = 0;
|
||||
unsigned int shndx2;
|
||||
|
||||
off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx);
|
||||
diff -rup binutils.orig/gold/layout.cc binutils-2.34.0/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2020-07-24 09:12:29.243306433 +0100
|
||||
+++ binutils-2.34.0/gold/layout.cc 2020-07-24 09:15:11.464320064 +0100
|
||||
@@ -1986,7 +1986,7 @@ Layout::attach_allocated_section_to_segm
|
||||
seg_flags |= os->extra_segment_flags();
|
||||
|
||||
// Check for --section-start.
|
||||
- uint64_t addr;
|
||||
+ uint64_t addr = 0;
|
||||
bool is_address_set = parameters->options().section_start(os->name(), &addr);
|
||||
|
||||
// In general the only thing we really care about for PT_LOAD
|
||||
diff -rup binutils.orig/binutils/dlltool.c binutils-2.34.0/binutils/dlltool.c
|
||||
--- binutils.orig/binutils/dlltool.c 2020-07-24 09:12:28.974308069 +0100
|
||||
+++ binutils-2.34.0/binutils/dlltool.c 2020-07-24 12:09:37.527121295 +0100
|
||||
@@ -1305,7 +1305,7 @@ run (const char *what, char *args)
|
||||
int pid, wait_status;
|
||||
int i;
|
||||
const char **argv;
|
||||
- char *errmsg_fmt, *errmsg_arg;
|
||||
+ char *errmsg_fmt = "", *errmsg_arg = "";
|
||||
char *temp_base = choose_temp_base ();
|
||||
|
||||
inform (_("run: %s %s"), what, args);
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 09:12:32.368287432 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:14:19.842360634 +0100
|
||||
@@ -28416,9 +28416,12 @@ md_apply_fix (fixS * fixP,
|
||||
perform relaxation. */
|
||||
if (value == -2)
|
||||
{
|
||||
- newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
- newval = 0xbf00; /* NOP encoding T1 */
|
||||
- md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
+ if (fixP->fx_done || !seg->use_rela_p)
|
||||
+ {
|
||||
+ newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
+ newval = 0xbf00; /* NOP encoding T1 */
|
||||
+ md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28631,17 +28634,14 @@ md_apply_fix (fixS * fixP,
|
||||
case BFD_RELOC_ARM_GOTFUNCDESC:
|
||||
case BFD_RELOC_ARM_GOTOFFFUNCDESC:
|
||||
case BFD_RELOC_ARM_FUNCDESC:
|
||||
- if (arm_fdpic)
|
||||
- {
|
||||
- if (fixP->fx_done || !seg->use_rela_p)
|
||||
- md_number_to_chars (buf, 0, 4);
|
||||
- }
|
||||
- else
|
||||
+ if (!arm_fdpic)
|
||||
{
|
||||
as_bad_where (fixP->fx_file, fixP->fx_line,
|
||||
_("Relocation supported only in FDPIC mode"));
|
||||
- }
|
||||
- break;
|
||||
+ break;
|
||||
+ }
|
||||
+ value = 0;
|
||||
+ /* Fall through. */
|
||||
#endif
|
||||
|
||||
case BFD_RELOC_RVA:
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 12:16:02.099719884 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:34:17.690858328 +0100
|
||||
@@ -28641,7 +28641,7 @@ md_apply_fix (fixS * fixP,
|
||||
break;
|
||||
}
|
||||
value = 0;
|
||||
- /* Fall through. */
|
||||
+ goto fred;
|
||||
#endif
|
||||
|
||||
case BFD_RELOC_RVA:
|
||||
@@ -28653,6 +28653,7 @@ md_apply_fix (fixS * fixP,
|
||||
#ifdef TE_PE
|
||||
case BFD_RELOC_32_SECREL:
|
||||
#endif
|
||||
+ fred:
|
||||
if (fixP->fx_done || !seg->use_rela_p)
|
||||
#ifdef TE_WINCE
|
||||
/* For WinCE we only do this for pcrel fixups. */
|
||||
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
|
||||
--- binutils.orig/gas/config/tc-arm.c 2020-07-24 13:28:26.926553452 +0100
|
||||
+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 13:31:57.835215763 +0100
|
||||
@@ -28416,12 +28416,8 @@ md_apply_fix (fixS * fixP,
|
||||
perform relaxation. */
|
||||
if (value == -2)
|
||||
{
|
||||
- if (fixP->fx_done || !seg->use_rela_p)
|
||||
- {
|
||||
- newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
- newval = 0xbf00; /* NOP encoding T1 */
|
||||
- md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
- }
|
||||
+ newval = 0xbf00; /* NOP encoding T1 */
|
||||
+ goto jim;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28432,6 +28428,7 @@ md_apply_fix (fixS * fixP,
|
||||
{
|
||||
newval = md_chars_to_number (buf, THUMB_SIZE);
|
||||
newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3);
|
||||
+ jim:
|
||||
md_number_to_chars (buf, newval, THUMB_SIZE);
|
||||
}
|
||||
}
|
||||
diff -rup binutils.orig/binutils/mclex.c binutils-2.34.0/binutils/mclex.c
|
||||
--- binutils.orig/binutils/mclex.c 2020-07-24 13:28:26.297557441 +0100
|
||||
+++ binutils-2.34.0/binutils/mclex.c 2020-07-24 14:46:53.587940149 +0100
|
||||
@@ -207,7 +207,7 @@ enum_severity (int e)
|
||||
static void
|
||||
mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv)
|
||||
{
|
||||
- unichar *usz, *usv = NULL;
|
||||
+ unichar *usz = NULL, *usv = NULL;
|
||||
rc_uint_type usz_len;
|
||||
|
||||
unicode_from_codepage (&usz_len, &usz, sz, CP_ACP);
|
||||
diff -rup binutils.orig/binutils/windmc.c binutils-2.34.0/binutils/windmc.c
|
||||
--- binutils.orig/binutils/windmc.c 2020-07-24 13:28:26.279557556 +0100
|
||||
+++ binutils-2.34.0/binutils/windmc.c 2020-07-24 14:48:05.460477478 +0100
|
||||
@@ -338,7 +338,7 @@ mc_add_node_lang (mc_node *root, const m
|
||||
static char *
|
||||
convert_unicode_to_ACP (const unichar *usz)
|
||||
{
|
||||
- char *s;
|
||||
+ char *s = NULL;
|
||||
rc_uint_type l;
|
||||
|
||||
if (! usz)
|
||||
@@ -607,10 +607,10 @@ mc_generate_bin_item (mc_node_lang *n, r
|
||||
else
|
||||
{
|
||||
rc_uint_type txt_len, l;
|
||||
- char *cvt_txt;
|
||||
+ char *cvt_txt = NULL;
|
||||
|
||||
codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp);
|
||||
- if (! cvt_txt)
|
||||
+ if (cvt_txt == NULL)
|
||||
fatal ("Failed to convert message to language codepage.\n");
|
||||
txt_len = strlen (cvt_txt);
|
||||
if (mcset_automatic_null_termination && txt_len > 0)
|
||||
@@ -1107,7 +1107,7 @@ main (int argc, char **argv)
|
||||
|
||||
/* Load the input file and do code page transformations to UTF16. */
|
||||
{
|
||||
- unichar *u;
|
||||
+ unichar *u = NULL;
|
||||
rc_uint_type ul;
|
||||
char *buff;
|
||||
bfd_size_type flen;
|
||||
--- binutils.orig/binutils/srconv.c 2020-07-24 15:37:25.847459208 +0100
|
||||
+++ binutils-2.34.0/binutils/srconv.c 2020-07-24 15:39:12.853773423 +0100
|
||||
@@ -316,6 +316,7 @@ wr_hd (struct coff_ofile *p)
|
||||
struct IT_hd hd;
|
||||
|
||||
hd.spare1 = 0;
|
||||
+ hd.spare2 = 0;
|
||||
if (bfd_get_file_flags (abfd) & EXEC_P)
|
||||
hd.mt = MTYPE_ABS_LM;
|
||||
else
|
|
@ -0,0 +1,11 @@
|
|||
--- binutils.orig/gold/dwp.cc 2023-05-02 13:26:44.075148082 +0100
|
||||
+++ binutils-2.40/gold/dwp.cc 2023-05-02 13:27:16.189130127 +0100
|
||||
@@ -2418,6 +2418,8 @@ main(int argc, char** argv)
|
||||
{
|
||||
Dwo_file exe_file(exe_filename);
|
||||
exe_file.read_executable(&files);
|
||||
+ if (files.empty())
|
||||
+ gold_fatal(_("Could not find any dwo links in specified EXE"));
|
||||
}
|
||||
|
||||
// Add any additional files listed on command line.
|
|
@ -0,0 +1,193 @@
|
|||
diff --git a/gold/i386.cc b/gold/i386.cc
|
||||
index bf209fe9a86..31161ff091c 100644
|
||||
--- a/gold/i386.cc
|
||||
+++ b/gold/i386.cc
|
||||
@@ -360,7 +360,11 @@ class Target_i386 : public Sized_target<32, false>
|
||||
got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL),
|
||||
got_tlsdesc_(NULL), global_offset_table_(NULL), rel_dyn_(NULL),
|
||||
rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY),
|
||||
- got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
|
||||
+ got_mod_index_offset_(-1U), tls_base_symbol_defined_(false),
|
||||
+ isa_1_used_(0), isa_1_needed_(0),
|
||||
+ feature_1_(0), feature_2_used_(0), feature_2_needed_(0),
|
||||
+ object_isa_1_used_(0), object_feature_1_(0),
|
||||
+ object_feature_2_used_(0), seen_first_object_(false)
|
||||
{ }
|
||||
|
||||
// Process the relocations to determine unreferenced sections for
|
||||
@@ -859,6 +863,21 @@ class Target_i386 : public Sized_target<32, false>
|
||||
this->rel_dyn_section(layout));
|
||||
}
|
||||
|
||||
+ // Record a target-specific program property in the .note.gnu.property
|
||||
+ // section.
|
||||
+ void
|
||||
+ record_gnu_property(unsigned int, unsigned int, size_t,
|
||||
+ const unsigned char*, const Object*);
|
||||
+
|
||||
+ // Merge the target-specific program properties from the current object.
|
||||
+ void
|
||||
+ merge_gnu_properties(const Object*);
|
||||
+
|
||||
+ // Finalize the target-specific program properties and add them back to
|
||||
+ // the layout.
|
||||
+ void
|
||||
+ do_finalize_gnu_properties(Layout*) const;
|
||||
+
|
||||
// Information about this specific target which we pass to the
|
||||
// general Target structure.
|
||||
static const Target::Target_info i386_info;
|
||||
@@ -898,6 +917,26 @@ class Target_i386 : public Sized_target<32, false>
|
||||
unsigned int got_mod_index_offset_;
|
||||
// True if the _TLS_MODULE_BASE_ symbol has been defined.
|
||||
bool tls_base_symbol_defined_;
|
||||
+
|
||||
+ // Target-specific program properties, from .note.gnu.property section.
|
||||
+ // Each bit represents a specific feature.
|
||||
+ uint32_t isa_1_used_;
|
||||
+ uint32_t isa_1_needed_;
|
||||
+ uint32_t feature_1_;
|
||||
+ uint32_t feature_2_used_;
|
||||
+ uint32_t feature_2_needed_;
|
||||
+ // Target-specific properties from the current object.
|
||||
+ // These bits get ORed into ISA_1_USED_ after all properties for the object
|
||||
+ // have been processed. But if either is all zeroes (as when the property
|
||||
+ // is absent from an object), the result should be all zeroes.
|
||||
+ // (See PR ld/23486.)
|
||||
+ uint32_t object_isa_1_used_;
|
||||
+ // These bits get ANDed into FEATURE_1_ after all properties for the object
|
||||
+ // have been processed.
|
||||
+ uint32_t object_feature_1_;
|
||||
+ uint32_t object_feature_2_used_;
|
||||
+ // Whether we have seen our first object, for use in initializing FEATURE_1_.
|
||||
+ bool seen_first_object_;
|
||||
};
|
||||
|
||||
const Target::Target_info Target_i386::i386_info =
|
||||
@@ -1042,6 +1081,126 @@ Target_i386::rel_irelative_section(Layout* layout)
|
||||
return this->rel_irelative_;
|
||||
}
|
||||
|
||||
+// Record a target-specific program property from the .note.gnu.property
|
||||
+// section.
|
||||
+void
|
||||
+Target_i386::record_gnu_property(
|
||||
+ unsigned int, unsigned int pr_type,
|
||||
+ size_t pr_datasz, const unsigned char* pr_data,
|
||||
+ const Object* object)
|
||||
+{
|
||||
+ uint32_t val = 0;
|
||||
+
|
||||
+ switch (pr_type)
|
||||
+ {
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
+ if (pr_datasz != 4)
|
||||
+ {
|
||||
+ gold_warning(_("%s: corrupt .note.gnu.property section "
|
||||
+ "(pr_datasz for property %d is not 4)"),
|
||||
+ object->name().c_str(), pr_type);
|
||||
+ return;
|
||||
+ }
|
||||
+ val = elfcpp::Swap<32, false>::readval(pr_data);
|
||||
+ break;
|
||||
+ default:
|
||||
+ gold_warning(_("%s: unknown program property type 0x%x "
|
||||
+ "in .note.gnu.property section"),
|
||||
+ object->name().c_str(), pr_type);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ switch (pr_type)
|
||||
+ {
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED:
|
||||
+ this->object_isa_1_used_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED:
|
||||
+ this->isa_1_needed_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND:
|
||||
+ // If we see multiple feature props in one object, OR them together.
|
||||
+ this->object_feature_1_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED:
|
||||
+ this->object_feature_2_used_ |= val;
|
||||
+ break;
|
||||
+ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED:
|
||||
+ this->feature_2_needed_ |= val;
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+// Merge the target-specific program properties from the current object.
|
||||
+void
|
||||
+Target_i386::merge_gnu_properties(const Object*)
|
||||
+{
|
||||
+ if (this->seen_first_object_)
|
||||
+ {
|
||||
+ // If any object is missing the ISA_1_USED property, we must omit
|
||||
+ // it from the output file.
|
||||
+ if (this->object_isa_1_used_ == 0)
|
||||
+ this->isa_1_used_ = 0;
|
||||
+ else if (this->isa_1_used_ != 0)
|
||||
+ this->isa_1_used_ |= this->object_isa_1_used_;
|
||||
+ this->feature_1_ &= this->object_feature_1_;
|
||||
+ // If any object is missing the FEATURE_2_USED property, we must
|
||||
+ // omit it from the output file.
|
||||
+ if (this->object_feature_2_used_ == 0)
|
||||
+ this->feature_2_used_ = 0;
|
||||
+ else if (this->feature_2_used_ != 0)
|
||||
+ this->feature_2_used_ |= this->object_feature_2_used_;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ this->isa_1_used_ = this->object_isa_1_used_;
|
||||
+ this->feature_1_ = this->object_feature_1_;
|
||||
+ this->feature_2_used_ = this->object_feature_2_used_;
|
||||
+ this->seen_first_object_ = true;
|
||||
+ }
|
||||
+ this->object_isa_1_used_ = 0;
|
||||
+ this->object_feature_1_ = 0;
|
||||
+ this->object_feature_2_used_ = 0;
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+add_property(Layout* layout, unsigned int pr_type, uint32_t val)
|
||||
+{
|
||||
+ unsigned char buf[4];
|
||||
+ elfcpp::Swap<32, false>::writeval(buf, val);
|
||||
+ layout->add_gnu_property(elfcpp::NT_GNU_PROPERTY_TYPE_0, pr_type, 4, buf);
|
||||
+}
|
||||
+
|
||||
+// Finalize the target-specific program properties and add them back to
|
||||
+// the layout.
|
||||
+void
|
||||
+Target_i386::do_finalize_gnu_properties(Layout* layout) const
|
||||
+{
|
||||
+ if (this->isa_1_used_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_USED,
|
||||
+ this->isa_1_used_);
|
||||
+ if (this->isa_1_needed_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED,
|
||||
+ this->isa_1_needed_);
|
||||
+ if (this->feature_1_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND,
|
||||
+ this->feature_1_);
|
||||
+ if (this->feature_2_used_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED,
|
||||
+ this->feature_2_used_);
|
||||
+ if (this->feature_2_needed_ != 0)
|
||||
+ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED,
|
||||
+ this->feature_2_needed_);
|
||||
+}
|
||||
+
|
||||
// Write the first three reserved words of the .got.plt section.
|
||||
// The remainder of the section is written while writing the PLT
|
||||
// in Output_data_plt_i386::do_write.
|
|
@ -1,10 +0,0 @@
|
|||
--- binutils.orig/gold/target-reloc.h 2018-07-12 11:37:24.894494658 +0100
|
||||
+++ binutils-2.30.90/gold/target-reloc.h 2018-07-12 15:38:50.049083904 +0100
|
||||
@@ -136,6 +136,7 @@ class Default_comdat_behavior
|
||||
if (Layout::is_debug_info_section(name))
|
||||
return CB_PRETEND;
|
||||
if (strcmp(name, ".eh_frame") == 0
|
||||
+ || strncmp(name, ".gnu.build.attributes", 21) == 0 // FIXME: We should really be checking the section type for ST_NOTE...
|
||||
|| strcmp(name, ".gcc_except_table") == 0)
|
||||
return CB_IGNORE;
|
||||
return CB_ERROR;
|
|
@ -0,0 +1,66 @@
|
|||
Only in binutils-2.34/gold: autom4te.cache
|
||||
diff -rup binutils.orig/gold/configure binutils-2.34/gold/configure
|
||||
--- binutils.orig/gold/configure 2020-04-20 12:35:13.048297305 +0100
|
||||
+++ binutils-2.34/gold/configure 2020-04-20 14:02:06.743725696 +0100
|
||||
@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do
|
||||
. ${srcdir}/configure.tgt
|
||||
|
||||
if test "$targ_obj" = "UNKNOWN"; then
|
||||
- as_fn_error $? "\"unsupported target $targ\"" "$LINENO" 5
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"unsupported target $targ\"" >&5
|
||||
+$as_echo "$as_me: WARNING: \"unsupported target $targ\"" >&2;}
|
||||
else
|
||||
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
|
||||
if test "$targ_extra_obj" != ""; then
|
||||
diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac
|
||||
--- binutils.orig/gold/configure.ac 2020-04-20 12:35:13.050297291 +0100
|
||||
+++ binutils-2.34/gold/configure.ac 2020-04-20 14:01:46.435868770 +0100
|
||||
@@ -181,7 +181,7 @@ for targ in $target $canon_targets; do
|
||||
. ${srcdir}/configure.tgt
|
||||
|
||||
if test "$targ_obj" = "UNKNOWN"; then
|
||||
- AC_MSG_ERROR("unsupported target $targ")
|
||||
+ AC_MSG_WARN("unsupported target $targ")
|
||||
else
|
||||
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
|
||||
if test "$targ_extra_obj" != ""; then
|
||||
--- binutils.orig/ld/configure.tgt 2020-04-20 12:35:12.465301359 +0100
|
||||
+++ binutils-2.34/ld/configure.tgt 2020-04-20 14:17:52.123066333 +0100
|
||||
@@ -220,7 +220,7 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfi
|
||||
targ_extra_emuls="elf32bfin"
|
||||
targ_extra_libpath=$targ_extra_emuls
|
||||
;;
|
||||
-bpf-*-*) targ_emul=elf64bpf
|
||||
+bpf-* | bpf-*-*) targ_emul=elf64bpf
|
||||
;;
|
||||
cr16-*-elf*) targ_emul=elf32cr16
|
||||
;;
|
||||
@@ -1026,7 +1026,7 @@ z8k-*-coff) targ_emul=z8002
|
||||
targ_extra_ofiles=
|
||||
;;
|
||||
*)
|
||||
- echo 2>&1 "*** ld does not support target ${targ}"
|
||||
+ echo 2>&1 "*** ld does not support target '${targ}' NO REALLY"
|
||||
echo 2>&1 "*** see ld/configure.tgt for supported targets"
|
||||
exit 1
|
||||
|
||||
--- binutils.orig/bfd/config.bfd 2020-04-20 12:35:13.038297375 +0100
|
||||
+++ binutils-2.34/bfd/config.bfd 2020-04-20 14:25:26.452869193 +0100
|
||||
@@ -473,7 +473,7 @@ case "${targ}" in
|
||||
;;
|
||||
|
||||
#ifdef BFD64
|
||||
- bpf-*-none)
|
||||
+ bpf-*-none | bpf-*)
|
||||
targ_defvec=bpf_elf64_le_vec
|
||||
targ_selvecs=bpf_elf64_be_vec
|
||||
targ_underscore=yes
|
||||
@@ -1427,7 +1427,7 @@ case "${targ}" in
|
||||
;;
|
||||
|
||||
*)
|
||||
- echo 1>&2 "*** BFD does not support target ${targ}."
|
||||
+ echo 1>&2 "*** BFD does not support target '${targ}'. Honest."
|
||||
echo 1>&2 "*** Look in bfd/config.bfd for supported targets."
|
||||
exit 1
|
||||
;;
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,158 @@
|
|||
From a0b911576eb49e06a457ebf757b42543d2c7e548 Mon Sep 17 00:00:00 2001
|
||||
From: Luca Boccassi <luca.boccassi@microsoft.com>
|
||||
Date: Wed, 21 Jul 2021 14:32:03 +0100
|
||||
Subject: [PATCH] Allows linker scripts to set the SEC_READONLY flag.
|
||||
|
||||
* ld.texi: Document new output section type.
|
||||
* ldgram.y: Add new token.
|
||||
* ldlang.c: Handle the new flag.
|
||||
* ldlang.h: Add readonly_section to list of section types.
|
||||
* ldlex.l: Add a new identifier.
|
||||
* testsuite/ld-scripts/output-section-types.t: New example linker script.
|
||||
* testsuite/ld-scripts/output-section-types.d: Test driver.
|
||||
* testsyute/ld-scripts/script.exp: Run the new test.
|
||||
|
||||
(cherry picked from commit 6b86da53d5ee2022b9065f445d23356190380746)
|
||||
---
|
||||
ld/ld.texi | 2 ++
|
||||
ld/ldgram.y | 2 ++
|
||||
ld/ldlang.c | 6 ++++++
|
||||
ld/ldlang.h | 3 ++-
|
||||
ld/ldlex.l | 1 +
|
||||
ld/testsuite/ld-scripts/output-section-types.d | 13 +++++++++++++
|
||||
ld/testsuite/ld-scripts/output-section-types.t | 7 +++++++
|
||||
ld/testsuite/ld-scripts/script.exp | 1 +
|
||||
8 files changed, 34 insertions(+), 1 deletion(-)
|
||||
create mode 100644 ld/testsuite/ld-scripts/output-section-types.d
|
||||
create mode 100644 ld/testsuite/ld-scripts/output-section-types.t
|
||||
|
||||
diff --git a/ld/ld.texi b/ld/ld.texi
|
||||
index dd8f571d4e4..cf1e637adbf 100644
|
||||
--- a/ld/ld.texi
|
||||
+++ b/ld/ld.texi
|
||||
@@ -5456,6 +5456,8 @@ parentheses. The following types are defined:
|
||||
@item NOLOAD
|
||||
The section should be marked as not loadable, so that it will not be
|
||||
loaded into memory when the program is run.
|
||||
+@item READONLY
|
||||
+The section should be marked as read-only.
|
||||
@item DSECT
|
||||
@itemx COPY
|
||||
@itemx INFO
|
||||
diff --git a/ld/ldgram.y b/ld/ldgram.y
|
||||
index dd911f46169..31e0071c6fc 100644
|
||||
--- a/ld/ldgram.y
|
||||
+++ b/ld/ldgram.y
|
||||
@@ -139,6 +139,7 @@ static int error_index;
|
||||
%token REGION_ALIAS
|
||||
%token LD_FEATURE
|
||||
%token NOLOAD DSECT COPY INFO OVERLAY
|
||||
+%token READONLY
|
||||
%token DEFINED TARGET_K SEARCH_DIR MAP ENTRY
|
||||
%token <integer> NEXT
|
||||
%token SIZEOF ALIGNOF ADDR LOADADDR MAX_K MIN_K
|
||||
@@ -1123,6 +1124,7 @@ type:
|
||||
| COPY { sectype = noalloc_section; }
|
||||
| INFO { sectype = noalloc_section; }
|
||||
| OVERLAY { sectype = noalloc_section; }
|
||||
+ | READONLY { sectype = readonly_section; }
|
||||
;
|
||||
|
||||
atype:
|
||||
diff --git a/ld/ldlang.c b/ld/ldlang.c
|
||||
index 37b64c89ee1..2610be995ca 100644
|
||||
--- a/ld/ldlang.c
|
||||
+++ b/ld/ldlang.c
|
||||
@@ -2639,6 +2639,9 @@ lang_add_section (lang_statement_list_type *ptr,
|
||||
case noalloc_section:
|
||||
flags &= ~SEC_ALLOC;
|
||||
break;
|
||||
+ case readonly_section:
|
||||
+ flags |= SEC_READONLY;
|
||||
+ break;
|
||||
case noload_section:
|
||||
flags &= ~SEC_LOAD;
|
||||
flags |= SEC_NEVER_LOAD;
|
||||
@@ -4232,6 +4235,9 @@ map_input_to_output_sections
|
||||
case noalloc_section:
|
||||
flags = SEC_HAS_CONTENTS;
|
||||
break;
|
||||
+ case readonly_section:
|
||||
+ flags |= SEC_READONLY;
|
||||
+ break;
|
||||
case noload_section:
|
||||
if (bfd_get_flavour (link_info.output_bfd)
|
||||
== bfd_target_elf_flavour)
|
||||
diff --git a/ld/ldlang.h b/ld/ldlang.h
|
||||
index 6fbe16d97d9..f68ae27b409 100644
|
||||
--- a/ld/ldlang.h
|
||||
+++ b/ld/ldlang.h
|
||||
@@ -121,7 +121,8 @@ enum section_type
|
||||
first_overlay_section,
|
||||
overlay_section,
|
||||
noload_section,
|
||||
- noalloc_section
|
||||
+ noalloc_section,
|
||||
+ readonly_section
|
||||
};
|
||||
|
||||
/* This structure holds a list of program headers describing
|
||||
diff --git a/ld/ldlex.l b/ld/ldlex.l
|
||||
index c1b15263587..25b4bcaae01 100644
|
||||
--- a/ld/ldlex.l
|
||||
+++ b/ld/ldlex.l
|
||||
@@ -294,6 +294,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
|
||||
<BOTH,SCRIPT>"SORT_BY_INIT_PRIORITY" { RTOKEN(SORT_BY_INIT_PRIORITY); }
|
||||
<BOTH,SCRIPT>"SORT_NONE" { RTOKEN(SORT_NONE); }
|
||||
<EXPRESSION,BOTH,SCRIPT>"NOLOAD" { RTOKEN(NOLOAD);}
|
||||
+<EXPRESSION,BOTH,SCRIPT>"READONLY" { RTOKEN(READONLY);}
|
||||
<EXPRESSION,BOTH,SCRIPT>"DSECT" { RTOKEN(DSECT);}
|
||||
<EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
|
||||
<EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
|
||||
diff --git a/ld/testsuite/ld-scripts/output-section-types.d b/ld/testsuite/ld-scripts/output-section-types.d
|
||||
new file mode 100644
|
||||
index 00000000000..ab124fa4dd7
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-scripts/output-section-types.d
|
||||
@@ -0,0 +1,13 @@
|
||||
+#ld: -Toutput-section-types.t
|
||||
+#source: align2a.s
|
||||
+#objdump: -h
|
||||
+#target: [is_elf_format]
|
||||
+
|
||||
+#...
|
||||
+ . \.rom.*
|
||||
+[ ]+ALLOC, READONLY
|
||||
+ . \.ro.*
|
||||
+[ ]+CONTENTS, ALLOC, LOAD, READONLY, DATA
|
||||
+ . \.over.*
|
||||
+[ ]+CONTENTS, READONLY
|
||||
+#pass
|
||||
diff --git a/ld/testsuite/ld-scripts/output-section-types.t b/ld/testsuite/ld-scripts/output-section-types.t
|
||||
new file mode 100644
|
||||
index 00000000000..d8fdfda1a03
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-scripts/output-section-types.t
|
||||
@@ -0,0 +1,7 @@
|
||||
+SECTIONS {
|
||||
+ .rom (NOLOAD) : { LONG(1234); }
|
||||
+ .ro (READONLY) : { LONG(5678); }
|
||||
+ .over (OVERLAY) : { LONG(0123); }
|
||||
+ /DISCARD/ : { *(*) }
|
||||
+
|
||||
+}
|
||||
diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp
|
||||
index 961cd08c4b1..ff50199b3ae 100644
|
||||
--- a/ld/testsuite/ld-scripts/script.exp
|
||||
+++ b/ld/testsuite/ld-scripts/script.exp
|
||||
@@ -229,6 +229,7 @@ foreach test_script $test_script_list {
|
||||
|
||||
run_dump_test "align-with-input"
|
||||
run_dump_test "pr20302"
|
||||
+run_dump_test "output-section-types"
|
||||
|
||||
run_dump_test "segment-start" {{name (default)}}
|
||||
run_dump_test "segment-start" {{name (overridden)} \
|
||||
--
|
||||
2.30.2
|
||||
|
|
@ -0,0 +1,283 @@
|
|||
diff -rup binutils.orig/libiberty/acinclude.m4 binutils-2.39/libiberty/acinclude.m4
|
||||
--- binutils.orig/libiberty/acinclude.m4 2022-11-23 14:41:57.639262100 +0000
|
||||
+++ binutils-2.39/libiberty/acinclude.m4 2022-11-23 14:43:07.139042148 +0000
|
||||
@@ -24,6 +24,8 @@ AC_CACHE_CHECK([for working strncmp], ac
|
||||
[AC_TRY_RUN([
|
||||
/* Test by Jim Wilson and Kaveh Ghazi.
|
||||
Check whether strncmp reads past the end of its string parameters. */
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
@@ -51,7 +53,8 @@ AC_CACHE_CHECK([for working strncmp], ac
|
||||
|
||||
#define MAP_LEN 0x10000
|
||||
|
||||
-main ()
|
||||
+int
|
||||
+main (void)
|
||||
{
|
||||
#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
|
||||
char *p;
|
||||
@@ -157,7 +160,10 @@ if test $ac_cv_os_cray = yes; then
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
|
||||
-[AC_TRY_RUN([find_stack_direction ()
|
||||
+[AC_TRY_RUN([#include <stdlib.h>
|
||||
+
|
||||
+int
|
||||
+find_stack_direction (void)
|
||||
{
|
||||
static char *addr = 0;
|
||||
auto char dummy;
|
||||
@@ -169,7 +175,9 @@ AC_CACHE_CHECK(stack direction for C all
|
||||
else
|
||||
return (&dummy > addr) ? 1 : -1;
|
||||
}
|
||||
-main ()
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
{
|
||||
exit (find_stack_direction() < 0);
|
||||
}],
|
||||
diff -rup binutils.orig/libiberty/configure binutils-2.39/libiberty/configure
|
||||
--- binutils.orig/libiberty/configure 2022-11-23 14:41:57.652262059 +0000
|
||||
+++ binutils-2.39/libiberty/configure 2022-11-23 14:46:31.556395168 +0000
|
||||
@@ -1766,7 +1766,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) >= 0)];
|
||||
test_array [0] = 0;
|
||||
@@ -1783,7 +1783,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
|
||||
test_array [0] = 0;
|
||||
@@ -1810,7 +1810,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) < 0)];
|
||||
test_array [0] = 0;
|
||||
@@ -1827,7 +1827,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
|
||||
test_array [0] = 0;
|
||||
@@ -1862,7 +1862,7 @@ while test "x$ac_lo" != "x$ac_hi"; do
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
|
||||
test_array [0] = 0;
|
||||
@@ -1892,7 +1892,7 @@ static unsigned long int ulongval () { r
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
|
||||
FILE *f = fopen ("conftest.val", "w");
|
||||
@@ -1952,7 +1952,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
if (sizeof ($2))
|
||||
return 0;
|
||||
@@ -1965,7 +1965,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
if (sizeof (($2)))
|
||||
return 0;
|
||||
@@ -2037,7 +2037,7 @@ choke me
|
||||
#endif
|
||||
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
return $2 ();
|
||||
;
|
||||
@@ -2077,7 +2077,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
#ifndef $as_decl_name
|
||||
#ifdef __cplusplus
|
||||
@@ -3459,7 +3459,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
|
||||
/* end confdefs.h. */
|
||||
#include <stdio.h>
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
printf ("hello world\n");
|
||||
;
|
||||
@@ -3487,7 +3487,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
|
||||
;
|
||||
@@ -3627,7 +3627,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
|
||||
/* end confdefs.h. */
|
||||
#include <stdio.h>
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
FILE *f = fopen ("conftest.out", "w");
|
||||
return ferror (f) || fclose (f) != 0;
|
||||
@@ -3692,7 +3692,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
|
||||
;
|
||||
@@ -3743,7 +3743,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
#ifndef __GNUC__
|
||||
choke me
|
||||
@@ -3784,7 +3784,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
|
||||
;
|
||||
@@ -3799,7 +3799,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
|
||||
;
|
||||
@@ -3815,7 +3815,7 @@ else
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
|
||||
;
|
||||
@@ -3901,7 +3901,7 @@ int pairnames (int, char **, FILE *(*)(s
|
||||
int argc;
|
||||
char **argv;
|
||||
int
|
||||
-main ()
|
||||
+main (void)
|
||||
{
|
||||
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
|
||||
;
|
||||
@@ -6919,7 +6919,10 @@ else
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
-find_stack_direction ()
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+int
|
||||
+find_stack_direction (void)
|
||||
{
|
||||
static char *addr = 0;
|
||||
auto char dummy;
|
||||
@@ -6931,7 +6934,9 @@ find_stack_direction ()
|
||||
else
|
||||
return (&dummy > addr) ? 1 : -1;
|
||||
}
|
||||
-main ()
|
||||
+
|
||||
+int
|
||||
+main (int)
|
||||
{
|
||||
exit (find_stack_direction() < 0);
|
||||
}
|
||||
@@ -7756,6 +7761,8 @@ else
|
||||
|
||||
/* Test by Jim Wilson and Kaveh Ghazi.
|
||||
Check whether strncmp reads past the end of its string parameters. */
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
@@ -7783,7 +7790,8 @@ else
|
||||
|
||||
#define MAP_LEN 0x10000
|
||||
|
||||
-main ()
|
||||
+int
|
||||
+main (void)
|
||||
{
|
||||
#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
|
||||
char *p;
|
||||
diff -rup binutils.orig/gas/acinclude.m4 binutils-2.39/gas/acinclude.m4
|
||||
--- binutils.orig/gas/acinclude.m4 2022-11-23 14:56:11.793442492 +0000
|
||||
+++ binutils-2.39/gas/acinclude.m4 2022-11-23 14:59:17.778057190 +0000
|
||||
@@ -23,6 +23,7 @@ AC_DEFUN([GAS_WORKING_ASSERT],
|
||||
[AC_MSG_CHECKING([for working assert macro])
|
||||
AC_CACHE_VAL(gas_cv_assert_ok,
|
||||
AC_TRY_LINK([#include <assert.h>
|
||||
+#include <string.h>
|
||||
#include <stdio.h>], [
|
||||
/* check for requoting problems */
|
||||
static int a, b, c, d;
|
||||
diff -rup binutils.orig/gas/configure binutils-2.39/gas/configure
|
||||
--- binutils.orig/gas/configure 2022-11-23 14:56:12.402441231 +0000
|
||||
+++ binutils-2.39/gas/configure 2022-11-23 14:59:37.266016817 +0000
|
||||
@@ -13758,6 +13758,7 @@ else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <assert.h>
|
||||
+#include <string.h>
|
||||
#include <stdio.h>
|
||||
int
|
||||
main ()
|
|
@ -0,0 +1,28 @@
|
|||
diff -rup binutils.orig/ltmain.sh binutils-2.37/ltmain.sh
|
||||
--- binutils.orig/ltmain.sh 2022-01-27 16:23:09.304207432 +0000
|
||||
+++ binutils-2.37/ltmain.sh 2022-01-27 16:23:18.380143759 +0000
|
||||
@@ -7103,6 +7103,7 @@ EOF
|
||||
rpath="$finalize_rpath"
|
||||
test "$mode" != relink && rpath="$compile_rpath$rpath"
|
||||
for libdir in $rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
@@ -7798,6 +7799,7 @@ EOF
|
||||
rpath=
|
||||
hardcode_libdirs=
|
||||
for libdir in $compile_rpath $finalize_rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
@@ -7849,6 +7851,7 @@ EOF
|
||||
rpath=
|
||||
hardcode_libdirs=
|
||||
for libdir in $finalize_rpath; do
|
||||
+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
|
||||
if test -n "$hardcode_libdir_flag_spec"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
if test -z "$hardcode_libdirs"; then
|
||||
Only in binutils-2.37: ltmain.sh.orig
|
|
@ -0,0 +1,44 @@
|
|||
--- binutils.orig/binutils/objcopy.c 2023-01-16 12:15:46.405649346 +0000
|
||||
+++ binutils-2.39/binutils/objcopy.c 2023-01-16 12:16:48.892667868 +0000
|
||||
@@ -2383,6 +2383,8 @@ merge_gnu_build_notes (bfd * ab
|
||||
other note then if they are both of the same type (open
|
||||
or func) then they can be merged and one deleted. If
|
||||
they are of different types then they cannot be merged. */
|
||||
+ objcopy_internal_note * prev_note = NULL;
|
||||
+
|
||||
for (pnote = pnotes; pnote < pnotes_end; pnote ++)
|
||||
{
|
||||
/* Skip already deleted notes.
|
||||
@@ -2404,7 +2406,9 @@ merge_gnu_build_notes (bfd * ab
|
||||
objcopy_internal_note * back;
|
||||
|
||||
/* Rule 2: Check to see if there is an identical previous note. */
|
||||
- for (iter = 0, back = pnote - 1; back >= pnotes; back --)
|
||||
+ for (iter = 0, back = prev_note ? prev_note : pnote - 1;
|
||||
+ back >= pnotes;
|
||||
+ back --)
|
||||
{
|
||||
if (is_deleted_note (back))
|
||||
continue;
|
||||
@@ -2466,11 +2470,18 @@ merge_gnu_build_notes (bfd * ab
|
||||
break;
|
||||
}
|
||||
}
|
||||
-#if DEBUG_MERGE
|
||||
+
|
||||
+
|
||||
if (! is_deleted_note (pnote))
|
||||
- merge_debug ("Unable to do anything with note at %#08lx\n",
|
||||
- (pnote->note.namedata - (char *) contents) - 12);
|
||||
+ {
|
||||
+ /* Keep a pointer to this note, so that we can
|
||||
+ start the next search for rule 2 matches here. */
|
||||
+ prev_note = pnote;
|
||||
+#if DEBUG_MERGE
|
||||
+ merge_debug ("Unable to do anything with note at %#08lx\n",
|
||||
+ (pnote->note.namedata - (char *) contents) - 12);
|
||||
#endif
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Resort the notes. */
|
|
@ -0,0 +1,197 @@
|
|||
diff -rup binutils.orig/gold/Makefile.am binutils-2.38/gold/Makefile.am
|
||||
--- binutils.orig/gold/Makefile.am 2022-08-04 11:11:01.788495165 +0100
|
||||
+++ binutils-2.38/gold/Makefile.am 2022-08-04 11:12:26.124013955 +0100
|
||||
@@ -35,7 +35,7 @@ THREADFLAGS = @PTHREAD_CFLAGS@
|
||||
THREADLIBS = @PTHREAD_LIBS@
|
||||
|
||||
AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS)
|
||||
-AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS)
|
||||
+AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS) $(JANSSON_CFLAGS)
|
||||
AM_LDFLAGS = $(THREADFLAGS)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
@@ -187,7 +187,7 @@ libgold_a_LIBADD = $(LIBOBJS)
|
||||
sources_var = main.cc
|
||||
deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
|
||||
ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \
|
||||
- $(THREADLIBS) $(LIBDL) $(ZLIB)
|
||||
+ $(THREADLIBS) $(LIBDL) $(ZLIB) $(JANSSON_LIBS)
|
||||
ldflags_var = $(GOLD_LDFLAGS)
|
||||
|
||||
ld_new_SOURCES = $(sources_var)
|
||||
@@ -201,12 +201,12 @@ incremental_dump_SOURCES = incremental-d
|
||||
incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
|
||||
$(LIBINTL_DEP)
|
||||
incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
|
||||
- $(THREADLIBS) $(LIBDL) $(ZLIB)
|
||||
+ $(THREADLIBS) $(LIBDL) $(ZLIB) $(JANSSON_LIBS)
|
||||
|
||||
dwp_SOURCES = dwp.cc
|
||||
dwp_DEPENDENCIES = libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
|
||||
dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADLIBS) \
|
||||
- $(LIBDL) $(ZLIB)
|
||||
+ $(LIBDL) $(ZLIB) $(JANSSON_LIBS)
|
||||
dwp_LDFLAGS = $(GOLD_LDFLAGS)
|
||||
|
||||
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/../bfd/development.sh
|
||||
diff -rup binutils.orig/gold/configure.ac binutils-2.38/gold/configure.ac
|
||||
--- binutils.orig/gold/configure.ac 2022-08-04 11:11:01.783495194 +0100
|
||||
+++ binutils-2.38/gold/configure.ac 2022-08-04 11:12:26.124013955 +0100
|
||||
@@ -591,6 +591,32 @@ if test "$threads" = "yes"; then
|
||||
fi
|
||||
AM_CONDITIONAL(THREADS, test "$threads" = "yes")
|
||||
|
||||
+# Used to validate --package-metadata= input. Disabled by default.
|
||||
+AC_ARG_ENABLE([jansson],
|
||||
+ [AS_HELP_STRING([--enable-jansson],
|
||||
+ [enable jansson [default=no]])],
|
||||
+ [enable_jansson=$enableval],
|
||||
+ [enable_jansson="no"])
|
||||
+
|
||||
+if test "x$enable_jansson" != "xno"; then
|
||||
+ PKG_PROG_PKG_CONFIG
|
||||
+ AS_IF([test -n "$PKG_CONFIG"],
|
||||
+ [
|
||||
+ PKG_CHECK_MODULES(JANSSON, [jansson],
|
||||
+ [
|
||||
+ AC_DEFINE(HAVE_JANSSON, 1, [The jansson library is to be used])
|
||||
+ AC_SUBST([JANSSON_CFLAGS])
|
||||
+ AC_SUBST([JANSSON_LIBS])
|
||||
+ ],
|
||||
+ [
|
||||
+ AC_MSG_ERROR([Cannot find jansson library])
|
||||
+ ])
|
||||
+ ],
|
||||
+ [
|
||||
+ AC_MSG_ERROR([Cannot find pkg-config])
|
||||
+ ])
|
||||
+fi
|
||||
+
|
||||
dnl We have to check these in C, not C++, because autoconf generates
|
||||
dnl tests which have no type information, and current glibc provides
|
||||
dnl multiple declarations of functions like basename when compiling
|
||||
diff -rup binutils.orig/gold/layout.cc binutils-2.38/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2022-08-04 11:11:01.783495194 +0100
|
||||
+++ binutils-2.38/gold/layout.cc 2022-08-04 11:12:26.125013949 +0100
|
||||
@@ -38,6 +38,9 @@
|
||||
#include <windows.h>
|
||||
#include <rpcdce.h>
|
||||
#endif
|
||||
+#ifdef HAVE_JANSSON
|
||||
+#include <jansson.h>
|
||||
+#endif
|
||||
|
||||
#include "parameters.h"
|
||||
#include "options.h"
|
||||
@@ -2439,6 +2442,7 @@ Layout::create_notes()
|
||||
this->create_gold_note();
|
||||
this->create_stack_segment();
|
||||
this->create_build_id();
|
||||
+ this->create_package_metadata();
|
||||
}
|
||||
|
||||
// Create the dynamic sections which are needed before we read the
|
||||
@@ -3536,6 +3540,52 @@ Layout::create_build_id()
|
||||
}
|
||||
}
|
||||
|
||||
+// If --package-metadata was used, set up the package metadata note.
|
||||
+// https://systemd.io/ELF_PACKAGE_METADATA/
|
||||
+
|
||||
+void
|
||||
+Layout::create_package_metadata()
|
||||
+{
|
||||
+ if (!parameters->options().user_set_package_metadata())
|
||||
+ return;
|
||||
+
|
||||
+ const char* desc = parameters->options().package_metadata();
|
||||
+ if (strcmp(desc, "") == 0)
|
||||
+ return;
|
||||
+
|
||||
+#ifdef HAVE_JANSSON
|
||||
+ json_error_t json_error;
|
||||
+ json_t *json = json_loads(desc, 0, &json_error);
|
||||
+ if (json)
|
||||
+ json_decref(json);
|
||||
+ else
|
||||
+ {
|
||||
+ gold_fatal(_("error: --package-metadata=%s does not contain valid "
|
||||
+ "JSON: %s\n"),
|
||||
+ desc, json_error.text);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ // Create the note.
|
||||
+ size_t trailing_padding;
|
||||
+ // Ensure the trailing NULL byte is always included, as per specification.
|
||||
+ size_t descsz = strlen(desc) + 1;
|
||||
+ Output_section* os = this->create_note("FDO", elfcpp::FDO_PACKAGING_METADATA,
|
||||
+ ".note.package", descsz, true,
|
||||
+ &trailing_padding);
|
||||
+ if (os == NULL)
|
||||
+ return;
|
||||
+
|
||||
+ Output_section_data* posd = new Output_data_const(desc, descsz, 4);
|
||||
+ os->add_output_section_data(posd);
|
||||
+
|
||||
+ if (trailing_padding != 0)
|
||||
+ {
|
||||
+ posd = new Output_data_zero_fill(trailing_padding, 0);
|
||||
+ os->add_output_section_data(posd);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
// If we have both .stabXX and .stabXXstr sections, then the sh_link
|
||||
// field of the former should point to the latter. I'm not sure who
|
||||
// started this, but the GNU linker does it, and some tools depend
|
||||
diff -rup binutils.orig/gold/layout.h binutils-2.38/gold/layout.h
|
||||
--- binutils.orig/gold/layout.h 2022-08-04 11:11:01.788495165 +0100
|
||||
+++ binutils-2.38/gold/layout.h 2022-08-04 11:12:26.125013949 +0100
|
||||
@@ -1107,6 +1107,10 @@ class Layout
|
||||
void
|
||||
create_build_id();
|
||||
|
||||
+ // Create a package metadata note if needed.
|
||||
+ void
|
||||
+ create_package_metadata();
|
||||
+
|
||||
// Link .stab and .stabstr sections.
|
||||
void
|
||||
link_stabs_sections();
|
||||
@@ -1453,6 +1457,8 @@ class Layout
|
||||
Gdb_index* gdb_index_data_;
|
||||
// The space for the build ID checksum if there is one.
|
||||
Output_section_data* build_id_note_;
|
||||
+ // The space for the package metadata JSON if there is one.
|
||||
+ Output_section_data* package_metadata_note_;
|
||||
// The output section containing dwarf abbreviations
|
||||
Output_reduced_debug_abbrev_section* debug_abbrev_;
|
||||
// The output section containing the dwarf debug info tree
|
||||
diff -rup binutils.orig/gold/options.h binutils-2.38/gold/options.h
|
||||
--- binutils.orig/gold/options.h 2022-08-04 11:11:01.785495182 +0100
|
||||
+++ binutils-2.38/gold/options.h 2022-08-04 11:12:26.125013949 +0100
|
||||
@@ -1102,6 +1102,10 @@ class General_options
|
||||
DEFINE_bool(p, options::ONE_DASH, 'p', false,
|
||||
N_("Ignored for ARM compatibility"), NULL);
|
||||
|
||||
+ DEFINE_optional_string(package_metadata, options::TWO_DASHES, '\0', NULL,
|
||||
+ N_("Generate package metadata note"),
|
||||
+ N_("[=JSON]"));
|
||||
+
|
||||
DEFINE_bool(pie, options::ONE_DASH, '\0', false,
|
||||
N_("Create a position independent executable"),
|
||||
N_("Do not create a position independent executable"));
|
||||
diff -rup binutils.orig/elfcpp/elfcpp.h binutils-2.38/elfcpp/elfcpp.h
|
||||
--- binutils.orig/elfcpp/elfcpp.h 2022-08-04 11:11:00.940500003 +0100
|
||||
+++ binutils-2.38/elfcpp/elfcpp.h 2022-08-04 11:12:26.124013955 +0100
|
||||
@@ -999,7 +999,9 @@ enum
|
||||
// string.
|
||||
NT_GNU_GOLD_VERSION = 4,
|
||||
// Program property note, as described in "Linux Extensions to the gABI".
|
||||
- NT_GNU_PROPERTY_TYPE_0 = 5
|
||||
+ NT_GNU_PROPERTY_TYPE_0 = 5,
|
||||
+ // FDO .note.package notes as defined on https://systemd.io/ELF_PACKAGE_METADATA/
|
||||
+ FDO_PACKAGING_METADATA = 0xcafe1a7e
|
||||
};
|
||||
|
||||
// The OS values which may appear in word 0 of a NT_GNU_ABI_TAG note.
|
|
@ -0,0 +1,29 @@
|
|||
--- binutils.orig/binutils/readelf.c 2022-10-03 13:20:42.707527855 +0100
|
||||
+++ binutils-2.39/binutils/readelf.c 2022-10-03 13:21:25.785436781 +0100
|
||||
@@ -6357,6 +6357,13 @@ get_32bit_section_headers (Filedata * fi
|
||||
/* PR binutils/17531: Cope with unexpected section header sizes. */
|
||||
if (size == 0 || num == 0)
|
||||
return false;
|
||||
+
|
||||
+ /* The section header cannot be at the start of the file - that is
|
||||
+ where the ELF file header is located. A file with absolutely no
|
||||
+ sections in it will use a shoff of 0. */
|
||||
+ if (filedata->file_header.e_shoff == 0)
|
||||
+ return false;
|
||||
+
|
||||
if (size < sizeof * shdrs)
|
||||
{
|
||||
if (! probe)
|
||||
@@ -6421,6 +6428,12 @@ get_64bit_section_headers (Filedata * fi
|
||||
if (size == 0 || num == 0)
|
||||
return false;
|
||||
|
||||
+ /* The section header cannot be at the start of the file - that is
|
||||
+ where the ELF file header is located. A file with absolutely no
|
||||
+ sections in it will use a shoff of 0. */
|
||||
+ if (filedata->file_header.e_shoff == 0)
|
||||
+ return false;
|
||||
+
|
||||
if (size < sizeof * shdrs)
|
||||
{
|
||||
if (! probe)
|
|
@ -1,25 +1,24 @@
|
|||
diff -rup binutils.orig/binutils/readelf.c binutils-2.29/binutils/readelf.c
|
||||
--- binutils.orig/binutils/readelf.c 2017-12-12 16:24:19.571221194 +0000
|
||||
+++ binutils-2.29/binutils/readelf.c 2017-12-12 16:27:26.997979803 +0000
|
||||
@@ -11018,12 +11018,14 @@ print_dynamic_symbol (bfd_vma si, unsign
|
||||
--- binutils.orig/binutils/readelf.c 2020-07-24 15:08:30.317597020 +0100
|
||||
+++ binutils-2.35/binutils/readelf.c 2020-07-24 15:09:39.029155552 +0100
|
||||
@@ -12069,11 +12069,13 @@ print_dynamic_symbol (Filedata *filedata
|
||||
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||
|
||||
printf (" %-7s", get_symbol_visibility (vis));
|
||||
printf (" %-7s", get_symbol_visibility (vis));
|
||||
+#if 0
|
||||
/* Check to see if any other bits in the st_other field are set.
|
||||
Note - displaying this information disrupts the layout of the
|
||||
table being generated, but for the moment this case is very
|
||||
rare. */
|
||||
table being generated, but for the moment this case is very rare. */
|
||||
if (psym->st_other ^ vis)
|
||||
printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||
+#endif
|
||||
}
|
||||
printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx));
|
||||
|
||||
printf (" %3.3s ", get_symbol_index_type (filedata, psym->st_shndx));
|
||||
@@ -11031,6 +11033,15 @@ print_dynamic_symbol (bfd_vma si, unsign
|
||||
print_symbol (25, GET_DYNAMIC_NAME (psym->st_name));
|
||||
else
|
||||
printf (_(" <corrupt: %14ld>"), psym->st_name);
|
||||
@@ -12112,7 +12114,17 @@ print_dynamic_symbol (Filedata *filedata
|
||||
version_string);
|
||||
}
|
||||
|
||||
- putchar ('\n');
|
||||
+#if 1
|
||||
+ {
|
||||
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||
|
@ -29,38 +28,8 @@ diff -rup binutils.orig/binutils/readelf.c binutils-2.29/binutils/readelf.c
|
|||
+ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||
+ }
|
||||
+#endif
|
||||
putchar ('\n');
|
||||
}
|
||||
+
|
||||
+ putchar ('\n');
|
||||
|
||||
--- binutils.orig/binutils/readelf.c 2017-12-12 16:36:21.806561149 +0000
|
||||
+++ binutils-2.29.1/binutils/readelf.c 2017-12-12 16:38:17.763168514 +0000
|
||||
@@ -11548,11 +11548,13 @@ process_symbol_table (FILE * file)
|
||||
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||
|
||||
printf (" %-7s", get_symbol_visibility (vis));
|
||||
+#if 0
|
||||
/* Check to see if any other bits in the st_other field are set.
|
||||
Note - displaying this information disrupts the layout of the
|
||||
table being generated, but for the moment this case is very rare. */
|
||||
if (psym->st_other ^ vis)
|
||||
printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||
+#endif
|
||||
}
|
||||
printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx));
|
||||
print_symbol (25, psym->st_name < strtab_size
|
||||
@@ -11571,7 +11573,15 @@ process_symbol_table (FILE * file)
|
||||
printf (sym_info == symbol_hidden ? "@%s" : "@@%s",
|
||||
version_string);
|
||||
}
|
||||
+#if 1
|
||||
+ {
|
||||
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
||||
|
||||
+ /* Check to see if any other bits in the st_other field are set. */
|
||||
+ if (psym->st_other ^ vis)
|
||||
+ printf (" \t[%s] ", get_symbol_other (filedata, psym->st_other ^ vis));
|
||||
+ }
|
||||
+#endif
|
||||
putchar ('\n');
|
||||
|
||||
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
|
||||
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
|
||||
&& section != NULL
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
--- binutils.orig/bfd/elf.c 2023-03-30 10:01:40.824181703 +0100
|
||||
+++ binutils-2.40/bfd/elf.c 2023-03-30 10:02:23.103135337 +0100
|
||||
@@ -3877,21 +3877,23 @@ assign_section_numbers (bfd *abfd, struc
|
||||
{
|
||||
case SHT_REL:
|
||||
case SHT_RELA:
|
||||
- /* A reloc section which we are treating as a normal BFD
|
||||
- section. sh_link is the section index of the symbol
|
||||
- table. sh_info is the section index of the section to
|
||||
- which the relocation entries apply. We assume that an
|
||||
- allocated reloc section uses the dynamic symbol table
|
||||
- if there is one. Otherwise we guess the normal symbol
|
||||
- table. FIXME: How can we be sure? */
|
||||
- if (d->this_hdr.sh_link == 0 && (sec->flags & SEC_ALLOC) != 0)
|
||||
+ /* sh_link is the section index of the symbol table.
|
||||
+ sh_info is the section index of the section to which the
|
||||
+ relocation entries apply. */
|
||||
+ if (d->this_hdr.sh_link == 0)
|
||||
{
|
||||
- s = bfd_get_section_by_name (abfd, ".dynsym");
|
||||
- if (s != NULL)
|
||||
- d->this_hdr.sh_link = elf_section_data (s)->this_idx;
|
||||
+ /* FIXME maybe: If this is a reloc section which we are
|
||||
+ treating as a normal section then we likely should
|
||||
+ not be assuming its sh_link is .dynsym or .symtab. */
|
||||
+ if ((sec->flags & SEC_ALLOC) != 0)
|
||||
+ {
|
||||
+ s = bfd_get_section_by_name (abfd, ".dynsym");
|
||||
+ if (s != NULL)
|
||||
+ d->this_hdr.sh_link = elf_section_data (s)->this_idx;
|
||||
+ }
|
||||
+ else
|
||||
+ d->this_hdr.sh_link = elf_onesymtab (abfd);
|
||||
}
|
||||
- if (d->this_hdr.sh_link == 0)
|
||||
- d->this_hdr.sh_link = elf_onesymtab (abfd);
|
||||
|
||||
s = elf_get_reloc_section (sec);
|
||||
if (s != NULL)
|
||||
--- binutils.orig/binutils/objcopy.c 2023-03-30 10:01:41.063181441 +0100
|
||||
+++ binutils-2.40/binutils/objcopy.c 2023-03-30 12:25:41.439108276 +0100
|
||||
@@ -2256,7 +2256,7 @@ merge_gnu_build_notes (bfd * ab
|
||||
{
|
||||
if (pnote->note.namedata[4] == '2')
|
||||
++ version_2_seen;
|
||||
- else if (pnote->note.namedata[4] == '3')
|
||||
+ else if (pnote->note.namedata[4] == '3' || pnote->note.namedata[4] == '4')
|
||||
++ version_3_seen;
|
||||
else
|
||||
{
|
|
@ -67,29 +67,6 @@ diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/tes
|
|||
#...
|
||||
+0x[0-9a-f]+ +\(PLTREL.*
|
||||
#...
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 13:32:39.405064420 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 15:06:53.694623801 +0000
|
||||
@@ -1,7 +1,4 @@
|
||||
-#...
|
||||
-Disassembly of section .plt.got:
|
||||
|
||||
-[a-f0-9]+ <[a-z_]+@plt>:
|
||||
-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*>
|
||||
+#...
|
||||
[ ]*[a-f0-9]+: 90 nop
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-ibt.dd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2017-11-15 13:32:39.412064336 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2017-11-15 15:06:35.148842897 +0000
|
||||
@@ -1,7 +1,3 @@
|
||||
#...
|
||||
-Disassembly of section .plt.got:
|
||||
-
|
||||
-[a-f0-9]+ <[_a-z]+@plt>:
|
||||
[ ]*[a-f0-9]+: f3 0f 1e fa endbr64
|
||||
-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <[_a-z]+>
|
||||
#pass
|
||||
diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd
|
||||
--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000
|
||||
+++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,36 @@
|
|||
diff -rup binutils.orig/ld/ld.1 binutils-2.38/ld/ld.1
|
||||
--- binutils.orig/ld/ld.1 2022-05-27 10:56:44.937044892 +0100
|
||||
+++ binutils-2.38/ld/ld.1 2022-05-27 11:10:50.311802310 +0100
|
||||
@@ -2595,7 +2595,7 @@ systems may not understand them. If you
|
||||
\&\fB\-\-enable\-new\-dtags\fR, the new dynamic tags will be created as needed
|
||||
and older dynamic tags will be omitted.
|
||||
If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be
|
||||
-created. By default, the new dynamic tags are not created. Note that
|
||||
+created. By default, the new dynamic tags are created. Note that
|
||||
those options are only available for \s-1ELF\s0 systems.
|
||||
.IP "\fB\-\-hash\-size=\fR\fInumber\fR" 4
|
||||
.IX Item "--hash-size=number"
|
||||
diff -rup binutils.orig/ld/ld.info binutils-2.38/ld/ld.info
|
||||
--- binutils.orig/ld/ld.info 2022-05-27 11:01:12.286346357 +0100
|
||||
+++ binutils-2.38/ld/ld.info 2022-05-27 11:11:24.585709176 +0100
|
||||
@@ -2236,7 +2236,7 @@ GNU linker:
|
||||
'--enable-new-dtags', the new dynamic tags will be created as
|
||||
needed and older dynamic tags will be omitted. If you specify
|
||||
'--disable-new-dtags', no new dynamic tags will be created. By
|
||||
- default, the new dynamic tags are not created. Note that those
|
||||
+ default, the new dynamic tags are created. Note that those
|
||||
options are only available for ELF systems.
|
||||
|
||||
'--hash-size=NUMBER'
|
||||
diff -rup binutils.orig/ld/ld.texi binutils-2.38/ld/ld.texi
|
||||
--- binutils.orig/ld/ld.texi 2022-05-27 11:01:24.081314960 +0100
|
||||
+++ binutils-2.38/ld/ld.texi 2022-05-27 11:10:05.608923798 +0100
|
||||
@@ -2796,7 +2796,7 @@ systems may not understand them. If you
|
||||
@option{--enable-new-dtags}, the new dynamic tags will be created as needed
|
||||
and older dynamic tags will be omitted.
|
||||
If you specify @option{--disable-new-dtags}, no new dynamic tags will be
|
||||
-created. By default, the new dynamic tags are not created. Note that
|
||||
+created. By default, the new dynamic tags are created. Note that
|
||||
those options are only available for ELF systems.
|
||||
|
||||
@kindex --hash-size=@var{number}
|
|
@ -1,9 +1,10 @@
|
|||
--- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000
|
||||
@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am
|
||||
--- binutils.orig/bfd/Makefile.am 2022-02-09 14:10:42.659300681 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.am 2022-02-09 14:12:40.562532916 +0000
|
||||
@@ -977,8 +977,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
@ -11,7 +12,7 @@
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -989,7 +989,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
||||
|
@ -20,12 +21,13 @@
|
|||
-e "s,@report_bugs_to@,$$report_bugs_to," \
|
||||
< $(srcdir)/version.h > $@; \
|
||||
echo "$${bfd_soversion}" > libtool-soversion
|
||||
--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000
|
||||
+++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000
|
||||
@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
|
||||
diff -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in
|
||||
--- binutils.orig/bfd/Makefile.in 2022-02-09 14:10:42.653300720 +0000
|
||||
+++ binutils-2.38/bfd/Makefile.in 2022-02-09 14:19:03.362040188 +0000
|
||||
@@ -2094,8 +2094,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC
|
||||
bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
|
||||
@echo "creating $@"
|
||||
@bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
$(AM_V_GEN)\
|
||||
bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
|
||||
- bfd_version_string="\"$(VERSION)\"" ;\
|
||||
- bfd_soversion="$(VERSION)" ;\
|
||||
+ bfd_version_string="\"$(VERSION)-%{release}\"" ;\
|
||||
|
@ -33,7 +35,7 @@
|
|||
bfd_version_package="\"$(PKGVERSION)\"" ;\
|
||||
report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
|
||||
. $(srcdir)/development.sh ;\
|
||||
@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
@@ -2106,7 +2106,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
|
||||
fi ;\
|
||||
$(SED) -e "s,@bfd_version@,$$bfd_version," \
|
||||
-e "s,@bfd_version_string@,$$bfd_version_string," \
|
1578
binutils.spec
1578
binutils.spec
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,15 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane.functional}
|
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# Build/PR gating tests for binutils
|
||||
#
|
||||
|
||||
/common:
|
||||
plan:
|
||||
import:
|
||||
url: https://src.fedoraproject.org/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/common
|
||||
|
||||
/kernel-rebuild:
|
||||
plan:
|
||||
import:
|
||||
url: https://src.fedoraproject.org/tests/binutils.git
|
||||
ref: main
|
||||
name: /plans/build-gating/kernel-rebuild
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when executed locally, or executed by CI system to gate a build or PR."
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != commit
|
||||
and trigger != build
|
||||
enabled: false
|
2
sources
2
sources
|
@ -1,2 +1,2 @@
|
|||
SHA512 (binutils-2.33.1.tar.xz) = b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac
|
||||
SHA512 (binutils-2.39.tar.xz) = 68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3
|
||||
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
|
||||
# Note - this is an rpm spec file, but it has been renamed in order to avoid
|
||||
# conflict with the real binutils.spec file.
|
||||
#
|
||||
# Its only use is to build a set of cross-binutils rpms by putting it into
|
||||
# the SPECS directory of an rpmbuild tree, installing the binutils source
|
||||
# rpm into the SOURCES directory and then running:
|
||||
#
|
||||
# rpmbuild -bb spec.binutils.cross
|
||||
|
||||
Summary: A meta collection of GNU binutils executables for cross builds
|
||||
Name: cross-binutils
|
||||
License: GPLv3+
|
||||
URL: https://sourceware.org/binutils
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# Configurable settings - adjust to match your needs:
|
||||
#
|
||||
|
||||
Version: 2.30
|
||||
Release: 89.el8
|
||||
|
||||
# The list of cross architectures to build.
|
||||
# Note: this list assumes that we are building on an x86_64-linux-gnu host.
|
||||
|
||||
%define arch_list aarch64-linux-gnu ppc64le-linux-gnu s390x-linux-gnu
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%define binutils_source_rpm binutils-%{version}-%{release}.src.rpm
|
||||
|
||||
Source: %{binutils_source_rpm}
|
||||
|
||||
# Provides: bundled(libiberty)
|
||||
|
||||
BuildRequires: autoconf automake
|
||||
BuildRequires: perl, sed, coreutils
|
||||
BuildRequires: gcc, bison
|
||||
BuildRequires: gettext, flex, zlib-devel
|
||||
BuildRequires: findutils, texinfo
|
||||
BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc
|
||||
# BuildRequires: elfutils-debuginfod-client-devel
|
||||
BuildRequires: rpm-build
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%description
|
||||
Provides a collection of cross built binutils for the targets
|
||||
supported by RHEL (aarch64, ppc64le, s390x).
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
%build
|
||||
|
||||
# Install the binutils sources.
|
||||
rpm -ivh %{_sourcedir}/%{binutils_source_rpm}
|
||||
|
||||
# Build each set of cross binutils individually.
|
||||
for f in %{arch_list}; do
|
||||
rpmbuild -bb --define "binutils_target $f" %{_specdir}/binutils.spec --without testsuite --without gold
|
||||
done
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
%changelog
|
||||
* Wed Nov 11 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-14
|
||||
- First release of cross binutils rpm.
|
Loading…
Reference in New Issue