Changeset 7c6ada9
- Timestamp:
- Jan 22, 2009, 4:15:28 PM (16 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 1f7883fe
- Parents:
- 1d76a1c5
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
BOOK/introduction/common/changelog.xml
r1d76a1c5 r7c6ada9 36 36 </listitem> 37 37 --> 38 39 <listitem> 40 <para>January 22, 2009</para> 41 <itemizedlist> 42 <listitem> 43 <para>[Jim] - Updated Binutils Branch Update Patch to -4.</para> 44 </listitem> 45 </itemizedlist> 46 </listitem> 38 47 39 48 <listitem> -
BOOK/patches.ent
r1d76a1c5 r7c6ada9 13 13 <!ENTITY bash-fixes-patch-size "8 KB"> 14 14 15 <!ENTITY binutils-branch_update-patch "binutils-&binutils-version;-branch_update- 3.patch">16 <!ENTITY binutils-branch_update-patch-md5 " 2251ba8ea2f18b54f0436d4fcac5f478">17 <!ENTITY binutils-branch_update-patch-size "1 12KB">15 <!ENTITY binutils-branch_update-patch "binutils-&binutils-version;-branch_update-4.patch"> 16 <!ENTITY binutils-branch_update-patch-md5 "4f587bb8161b08e60b7e7bc98c56ff7d"> 17 <!ENTITY binutils-branch_update-patch-size "120 KB"> 18 18 19 19 <!ENTITY binutils-posix-patch "binutils-&binutils-version;-posix-1.patch"> -
patches/binutils-2.19-branch_update-4.patch
r1d76a1c5 r7c6ada9 1 1 Submitted By: Jim Gifford (jim at cross-lfs dot org) 2 Date: 01- 08-20092 Date: 01-22-2009 3 3 Initial Package Version: 2.19 4 4 Origin: Upstream … … 9 9 diff -Naur binutils-2.19.orig/bfd/ChangeLog binutils-2.19/bfd/ChangeLog 10 10 --- binutils-2.19.orig/bfd/ChangeLog 2008-10-16 06:20:48.000000000 -0700 11 +++ binutils-2.19/bfd/ChangeLog 2008-12-23 02:06:46.000000000 -0800 12 @@ -1,3 +1,31 @@ 11 +++ binutils-2.19/bfd/ChangeLog 2009-01-14 01:13:49.000000000 -0800 12 @@ -1,3 +1,37 @@ 13 +2009-01-14 Joseph Myers <joseph@codesourcery.com> 14 + 15 + * elf32-arm.c (elf32_arm_final_link_relocate): Do not turn 16 + branches to undefine weak symbols into branches to the next 17 + instruction if creating PLT entries for those symbols. 18 + 13 19 +2008-12-23 Nick Clifton <nickc@redhat.com> 14 20 + … … 42 48 43 49 * configure.in: Bump version to 2.19 44 diff -Naur binutils-2.19.orig/bfd/Makefile.in binutils-2.19/bfd/Makefile.in45 --- binutils-2.19.orig/bfd/Makefile.in 2008-10-16 06:20:48.000000000 -070046 +++ binutils-2.19/bfd/Makefile.in 2009-01-08 19:31:54.000000000 -080047 @@ -271,7 +271,7 @@48 ACLOCAL_AMFLAGS = -I . -I .. -I ../config49 50 # Uncomment the following line when doing a release.51 -RELEASE = y52 +RELEASE=y53 INCDIR = $(srcdir)/../include54 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)55 MKDEP = gcc -MM56 50 diff -Naur binutils-2.19.orig/bfd/configure binutils-2.19/bfd/configure 57 51 --- binutils-2.19.orig/bfd/configure 2008-10-16 06:20:42.000000000 -0700 … … 78 72 dnl These must be called before LT_INIT, because it may want 79 73 dnl to call AC_CHECK_PROG. 80 diff -Naur binutils-2.19.orig/bfd/elf.c binutils-2.19/bfd/elf.c 81 --- binutils-2.19.orig/bfd/elf.c 2008-10-09 05:18:23.000000000 -0700 82 +++ binutils-2.19/bfd/elf.c 2008-12-23 02:06:46.000000000 -0800 83 @@ -4606,7 +4606,61 @@ 84 m != NULL; 85 m = m->next, p++) 86 { 87 - if (m->count != 0) 88 + if (p->p_type == PT_GNU_RELRO) 89 + { 90 + const Elf_Internal_Phdr *lp; 91 + 92 + BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs); 93 + 94 + if (link_info != NULL) 95 + { 96 + /* During linking the range of the RELRO segment is passed 97 + in link_info. */ 98 + for (lp = phdrs; lp < phdrs + count; ++lp) 99 + { 100 + if (lp->p_type == PT_LOAD 101 + && lp->p_vaddr >= link_info->relro_start 102 + && lp->p_vaddr < link_info->relro_end 103 + && lp->p_vaddr + lp->p_filesz >= link_info->relro_end) 104 + break; 105 + } 106 + } 107 + else 108 + { 109 + /* Otherwise we are copying an executable or shared 110 + library, but we need to use the same linker logic. */ 111 + for (lp = phdrs; lp < phdrs + count; ++lp) 112 + { 113 + if (lp->p_type == PT_LOAD 114 + && lp->p_paddr == p->p_paddr) 115 + break; 116 + } 117 + } 118 + 119 + if (lp < phdrs + count) 120 + { 121 + p->p_vaddr = lp->p_vaddr; 122 + p->p_paddr = lp->p_paddr; 123 + p->p_offset = lp->p_offset; 124 + if (link_info != NULL) 125 + p->p_filesz = link_info->relro_end - lp->p_vaddr; 126 + else if (m->p_size_valid) 127 + p->p_filesz = m->p_size; 128 + else 129 + abort (); 130 + p->p_memsz = p->p_filesz; 131 + p->p_align = 1; 132 + p->p_flags = (lp->p_flags & ~PF_W); 133 + } 134 + else if (link_info != NULL) 135 + { 136 + memset (p, 0, sizeof *p); 137 + p->p_type = PT_NULL; 138 + } 139 + else 140 + abort (); 141 + } 142 + else if (m->count != 0) 143 { 144 if (p->p_type != PT_LOAD 145 && (p->p_type != PT_NOTE 146 @@ -4622,87 +4676,20 @@ 147 p->p_filesz = sect->filepos - m->sections[0]->filepos; 148 if (hdr->sh_type != SHT_NOBITS) 149 p->p_filesz += hdr->sh_size; 150 - 151 - if (p->p_type == PT_GNU_RELRO) 152 - { 153 - /* When we get here, we are copying executable 154 - or shared library. But we need to use the same 155 - linker logic. */ 156 - Elf_Internal_Phdr *lp; 157 - 158 - for (lp = phdrs; lp < phdrs + count; ++lp) 159 - { 160 - if (lp->p_type == PT_LOAD 161 - && lp->p_paddr == p->p_paddr) 162 - break; 163 - } 164 - 165 - if (lp < phdrs + count) 166 - { 167 - /* We should use p_size if it is valid since it 168 - may contain the first few bytes of the next 169 - SEC_ALLOC section. */ 170 - if (m->p_size_valid) 171 - p->p_filesz = m->p_size; 172 - else 173 - abort (); 174 - p->p_vaddr = lp->p_vaddr; 175 - p->p_offset = lp->p_offset; 176 - p->p_memsz = p->p_filesz; 177 - p->p_align = 1; 178 - } 179 - else 180 - abort (); 181 - } 182 - else 183 - p->p_offset = m->sections[0]->filepos; 184 + p->p_offset = m->sections[0]->filepos; 185 } 186 } 187 - else 188 + else if (m->includes_filehdr) 189 { 190 - if (m->includes_filehdr) 191 - { 192 - p->p_vaddr = filehdr_vaddr; 193 - if (! m->p_paddr_valid) 194 - p->p_paddr = filehdr_paddr; 195 - } 196 - else if (m->includes_phdrs) 197 - { 198 - p->p_vaddr = phdrs_vaddr; 199 - if (! m->p_paddr_valid) 200 - p->p_paddr = phdrs_paddr; 201 - } 202 - else if (p->p_type == PT_GNU_RELRO) 203 - { 204 - Elf_Internal_Phdr *lp; 205 - 206 - for (lp = phdrs; lp < phdrs + count; ++lp) 207 - { 208 - if (lp->p_type == PT_LOAD 209 - && lp->p_vaddr <= link_info->relro_end 210 - && lp->p_vaddr >= link_info->relro_start 211 - && (lp->p_vaddr + lp->p_filesz 212 - >= link_info->relro_end)) 213 - break; 214 - } 215 - 216 - if (lp < phdrs + count 217 - && link_info->relro_end > lp->p_vaddr) 218 - { 219 - p->p_vaddr = lp->p_vaddr; 220 - p->p_paddr = lp->p_paddr; 221 - p->p_offset = lp->p_offset; 222 - p->p_filesz = link_info->relro_end - lp->p_vaddr; 223 - p->p_memsz = p->p_filesz; 224 - p->p_align = 1; 225 - p->p_flags = (lp->p_flags & ~PF_W); 226 - } 227 - else 228 - { 229 - memset (p, 0, sizeof *p); 230 - p->p_type = PT_NULL; 231 - } 232 - } 233 + p->p_vaddr = filehdr_vaddr; 234 + if (! m->p_paddr_valid) 235 + p->p_paddr = filehdr_paddr; 236 + } 237 + else if (m->includes_phdrs) 238 + { 239 + p->p_vaddr = phdrs_vaddr; 240 + if (! m->p_paddr_valid) 241 + p->p_paddr = phdrs_paddr; 242 } 243 } 244 74 diff -Naur binutils-2.19.orig/bfd/doc/bfdver.texi binutils-2.19/bfd/doc/bfdver.texi 75 --- binutils-2.19.orig/bfd/doc/bfdver.texi 2008-10-16 06:45:29.000000000 -0700 76 +++ binutils-2.19/bfd/doc/bfdver.texi 2009-01-14 01:00:24.000000000 -0800 77 @@ -1,4 +1,4 @@ 78 -@set VERSION 2.19 79 +@set VERSION 2.19.0 80 @set VERSION_PACKAGE (GNU Binutils) 81 -@set UPDATED October 2008 82 +@set UPDATED December 2008 83 @set BUGURL @uref{http://www.sourceware.org/bugzilla/} 84 diff -Naur binutils-2.19.orig/bfd/elf32-arm.c binutils-2.19/bfd/elf32-arm.c 85 --- binutils-2.19.orig/bfd/elf32-arm.c 2008-08-26 07:40:18.000000000 -0700 86 +++ binutils-2.19/bfd/elf32-arm.c 2009-01-14 01:13:49.000000000 -0800 87 @@ -6381,8 +6381,9 @@ 88 int thumb2 = using_thumb2 (globals); 89 90 /* A branch to an undefined weak symbol is turned into a jump to 91 - the next instruction. */ 92 - if (h && h->root.type == bfd_link_hash_undefweak) 93 + the next instruction unless a PLT entry will be created. */ 94 + if (h && h->root.type == bfd_link_hash_undefweak 95 + && !(splt != NULL && h->plt.offset != (bfd_vma) -1)) 96 { 97 bfd_put_16 (input_bfd, 0xe000, hit_data); 98 bfd_put_16 (input_bfd, 0xbf00, hit_data + 2); 245 99 diff -Naur binutils-2.19.orig/bfd/elf32-avr.c binutils-2.19/bfd/elf32-avr.c 246 100 --- binutils-2.19.orig/bfd/elf32-avr.c 2008-08-08 22:35:12.000000000 -0700 … … 402 256 outrel.r_addend += relocation; 403 257 if (tls_ty & (TLS_GD | TLS_DTPREL | TLS_TPREL)) 258 diff -Naur binutils-2.19.orig/bfd/elf.c binutils-2.19/bfd/elf.c 259 --- binutils-2.19.orig/bfd/elf.c 2008-10-09 05:18:23.000000000 -0700 260 +++ binutils-2.19/bfd/elf.c 2008-12-23 02:06:46.000000000 -0800 261 @@ -4606,7 +4606,61 @@ 262 m != NULL; 263 m = m->next, p++) 264 { 265 - if (m->count != 0) 266 + if (p->p_type == PT_GNU_RELRO) 267 + { 268 + const Elf_Internal_Phdr *lp; 269 + 270 + BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs); 271 + 272 + if (link_info != NULL) 273 + { 274 + /* During linking the range of the RELRO segment is passed 275 + in link_info. */ 276 + for (lp = phdrs; lp < phdrs + count; ++lp) 277 + { 278 + if (lp->p_type == PT_LOAD 279 + && lp->p_vaddr >= link_info->relro_start 280 + && lp->p_vaddr < link_info->relro_end 281 + && lp->p_vaddr + lp->p_filesz >= link_info->relro_end) 282 + break; 283 + } 284 + } 285 + else 286 + { 287 + /* Otherwise we are copying an executable or shared 288 + library, but we need to use the same linker logic. */ 289 + for (lp = phdrs; lp < phdrs + count; ++lp) 290 + { 291 + if (lp->p_type == PT_LOAD 292 + && lp->p_paddr == p->p_paddr) 293 + break; 294 + } 295 + } 296 + 297 + if (lp < phdrs + count) 298 + { 299 + p->p_vaddr = lp->p_vaddr; 300 + p->p_paddr = lp->p_paddr; 301 + p->p_offset = lp->p_offset; 302 + if (link_info != NULL) 303 + p->p_filesz = link_info->relro_end - lp->p_vaddr; 304 + else if (m->p_size_valid) 305 + p->p_filesz = m->p_size; 306 + else 307 + abort (); 308 + p->p_memsz = p->p_filesz; 309 + p->p_align = 1; 310 + p->p_flags = (lp->p_flags & ~PF_W); 311 + } 312 + else if (link_info != NULL) 313 + { 314 + memset (p, 0, sizeof *p); 315 + p->p_type = PT_NULL; 316 + } 317 + else 318 + abort (); 319 + } 320 + else if (m->count != 0) 321 { 322 if (p->p_type != PT_LOAD 323 && (p->p_type != PT_NOTE 324 @@ -4622,87 +4676,20 @@ 325 p->p_filesz = sect->filepos - m->sections[0]->filepos; 326 if (hdr->sh_type != SHT_NOBITS) 327 p->p_filesz += hdr->sh_size; 328 - 329 - if (p->p_type == PT_GNU_RELRO) 330 - { 331 - /* When we get here, we are copying executable 332 - or shared library. But we need to use the same 333 - linker logic. */ 334 - Elf_Internal_Phdr *lp; 335 - 336 - for (lp = phdrs; lp < phdrs + count; ++lp) 337 - { 338 - if (lp->p_type == PT_LOAD 339 - && lp->p_paddr == p->p_paddr) 340 - break; 341 - } 342 - 343 - if (lp < phdrs + count) 344 - { 345 - /* We should use p_size if it is valid since it 346 - may contain the first few bytes of the next 347 - SEC_ALLOC section. */ 348 - if (m->p_size_valid) 349 - p->p_filesz = m->p_size; 350 - else 351 - abort (); 352 - p->p_vaddr = lp->p_vaddr; 353 - p->p_offset = lp->p_offset; 354 - p->p_memsz = p->p_filesz; 355 - p->p_align = 1; 356 - } 357 - else 358 - abort (); 359 - } 360 - else 361 - p->p_offset = m->sections[0]->filepos; 362 + p->p_offset = m->sections[0]->filepos; 363 } 364 } 365 - else 366 + else if (m->includes_filehdr) 367 { 368 - if (m->includes_filehdr) 369 - { 370 - p->p_vaddr = filehdr_vaddr; 371 - if (! m->p_paddr_valid) 372 - p->p_paddr = filehdr_paddr; 373 - } 374 - else if (m->includes_phdrs) 375 - { 376 - p->p_vaddr = phdrs_vaddr; 377 - if (! m->p_paddr_valid) 378 - p->p_paddr = phdrs_paddr; 379 - } 380 - else if (p->p_type == PT_GNU_RELRO) 381 - { 382 - Elf_Internal_Phdr *lp; 383 - 384 - for (lp = phdrs; lp < phdrs + count; ++lp) 385 - { 386 - if (lp->p_type == PT_LOAD 387 - && lp->p_vaddr <= link_info->relro_end 388 - && lp->p_vaddr >= link_info->relro_start 389 - && (lp->p_vaddr + lp->p_filesz 390 - >= link_info->relro_end)) 391 - break; 392 - } 393 - 394 - if (lp < phdrs + count 395 - && link_info->relro_end > lp->p_vaddr) 396 - { 397 - p->p_vaddr = lp->p_vaddr; 398 - p->p_paddr = lp->p_paddr; 399 - p->p_offset = lp->p_offset; 400 - p->p_filesz = link_info->relro_end - lp->p_vaddr; 401 - p->p_memsz = p->p_filesz; 402 - p->p_align = 1; 403 - p->p_flags = (lp->p_flags & ~PF_W); 404 - } 405 - else 406 - { 407 - memset (p, 0, sizeof *p); 408 - p->p_type = PT_NULL; 409 - } 410 - } 411 + p->p_vaddr = filehdr_vaddr; 412 + if (! m->p_paddr_valid) 413 + p->p_paddr = filehdr_paddr; 414 + } 415 + else if (m->includes_phdrs) 416 + { 417 + p->p_vaddr = phdrs_vaddr; 418 + if (! m->p_paddr_valid) 419 + p->p_paddr = phdrs_paddr; 420 } 421 } 422 423 diff -Naur binutils-2.19.orig/bfd/Makefile.in binutils-2.19/bfd/Makefile.in 424 --- binutils-2.19.orig/bfd/Makefile.in 2008-10-16 06:20:48.000000000 -0700 425 +++ binutils-2.19/bfd/Makefile.in 2009-01-22 16:10:32.431360245 -0800 426 @@ -271,7 +271,7 @@ 427 ACLOCAL_AMFLAGS = -I . -I .. -I ../config 428 429 # Uncomment the following line when doing a release. 430 -RELEASE = y 431 +RELEASE=y 432 INCDIR = $(srcdir)/../include 433 CSEARCH = -I. -I$(srcdir) -I$(INCDIR) 434 MKDEP = gcc -MM 404 435 diff -Naur binutils-2.19.orig/bfd/version.h binutils-2.19/bfd/version.h 405 436 --- binutils-2.19.orig/bfd/version.h 2008-10-16 05:51:57.000000000 -0700 406 +++ binutils-2.19/bfd/version.h 2009-01- 08 16:00:10.000000000 -0800437 +++ binutils-2.19/bfd/version.h 2009-01-22 16:00:14.000000000 -0800 407 438 @@ -1,4 +1,4 @@ 408 439 -#define BFD_VERSION_DATE 20081016 409 +#define BFD_VERSION_DATE 200901 09440 +#define BFD_VERSION_DATE 20090123 410 441 #define BFD_VERSION @bfd_version@ 411 442 #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ … … 501 532 diff -Naur binutils-2.19.orig/gas/ChangeLog binutils-2.19/gas/ChangeLog 502 533 --- binutils-2.19.orig/gas/ChangeLog 2008-10-16 05:52:03.000000000 -0700 503 +++ binutils-2.19/gas/ChangeLog 2009-01-08 16:16:11.000000000 -0800 504 @@ -1,3 +1,12 @@ 534 +++ binutils-2.19/gas/ChangeLog 2009-01-14 01:00:24.000000000 -0800 535 @@ -1,3 +1,29 @@ 536 +2009-01-14 Jakub Jelinek <jakub@redhat.com> 537 + 538 + * Makefile.am (ehopt.o): Add struc-symbol.h. 539 + * Makefile.in: Regenerated. 540 + * ehopt.c: Include struc-symbol.h. 541 + (check_eh_frame): For very small O_constant DW_CFA_advance_loc4 542 + create correct DW_CFA_advance_loc. Handle O_subtract only 543 + for code alignment factor 1, otherwise handle O_divide or 544 + O_right_shift of O_subtract and O_constant. 545 + (eh_frame_estimate_size_before_relax): Always divide by ca. 546 + (eh_frame_convert_frag): Likewise. 547 + 548 +2009-01-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 549 + 550 + * dw2gencfi.c (output_cfi_insn): Scale DW_CFA_advance_loc1, 551 + DW_CFA_advance_loc2 and DW_CFA_advance_loc4 outputs. 552 + 505 553 +2009-01-08 Adam Nemet <anemet@caviumnetworks.com> 506 554 + … … 534 582 /* MIPS PIC level. */ 535 583 584 diff -Naur binutils-2.19.orig/gas/dw2gencfi.c binutils-2.19/gas/dw2gencfi.c 585 --- binutils-2.19.orig/gas/dw2gencfi.c 2008-10-16 05:52:09.000000000 -0700 586 +++ binutils-2.19/gas/dw2gencfi.c 2009-01-14 01:00:24.000000000 -0800 587 @@ -1,5 +1,5 @@ 588 /* dw2gencfi.c - Support for generating Dwarf2 CFI information. 589 - Copyright 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 590 + Copyright 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 591 Contributed by Michal Ludvig <mludvig@suse.cz> 592 593 This file is part of GAS, the GNU Assembler. 594 @@ -972,20 +972,20 @@ 595 596 if (scaled <= 0x3F) 597 out_one (DW_CFA_advance_loc + scaled); 598 - else if (delta <= 0xFF) 599 + else if (scaled <= 0xFF) 600 { 601 out_one (DW_CFA_advance_loc1); 602 - out_one (delta); 603 + out_one (scaled); 604 } 605 - else if (delta <= 0xFFFF) 606 + else if (scaled <= 0xFFFF) 607 { 608 out_one (DW_CFA_advance_loc2); 609 - out_two (delta); 610 + out_two (scaled); 611 } 612 else 613 { 614 out_one (DW_CFA_advance_loc4); 615 - out_four (delta); 616 + out_four (scaled); 617 } 618 } 619 else 620 diff -Naur binutils-2.19.orig/gas/ehopt.c binutils-2.19/gas/ehopt.c 621 --- binutils-2.19.orig/gas/ehopt.c 2007-11-06 09:15:10.000000000 -0800 622 +++ binutils-2.19/gas/ehopt.c 2009-01-14 01:00:25.000000000 -0800 623 @@ -1,5 +1,6 @@ 624 /* ehopt.c--optimize gcc exception frame information. 625 - Copyright 1998, 2000, 2001, 2003, 2005, 2007 Free Software Foundation, Inc. 626 + Copyright 1998, 2000, 2001, 2003, 2005, 2007, 2008 627 + Free Software Foundation, Inc. 628 Written by Ian Lance Taylor <ian@cygnus.com>. 629 630 This file is part of GAS, the GNU Assembler. 631 @@ -21,6 +22,7 @@ 632 633 #include "as.h" 634 #include "subsegs.h" 635 +#include "struc-symbol.h" 636 637 /* We include this ELF file, even though we may not be assembling for 638 ELF, since the exception frame information is always in a format 639 @@ -398,13 +400,10 @@ 640 subtracted were in the same frag and the expression was 641 reduced to a constant. We can do the optimization entirely 642 in this function. */ 643 - if (d->cie_info.code_alignment > 0 644 - && exp->X_add_number % d->cie_info.code_alignment == 0 645 - && exp->X_add_number / d->cie_info.code_alignment < 0x40) 646 + if (exp->X_add_number < 0x40) 647 { 648 d->loc4_frag->fr_literal[d->loc4_fix] 649 - = DW_CFA_advance_loc 650 - | (exp->X_add_number / d->cie_info.code_alignment); 651 + = DW_CFA_advance_loc | exp->X_add_number; 652 /* No more bytes needed. */ 653 return 1; 654 } 655 @@ -419,23 +418,39 @@ 656 *pnbytes = 2; 657 } 658 } 659 - else if (exp->X_op == O_subtract) 660 + else if (exp->X_op == O_subtract && d->cie_info.code_alignment == 1) 661 { 662 /* This is a case we can optimize. The expression was not 663 reduced, so we can not finish the optimization until the end 664 of the assembly. We set up a variant frag which we handle 665 later. */ 666 - int fr_subtype; 667 - 668 - if (d->cie_info.code_alignment > 0) 669 - fr_subtype = d->cie_info.code_alignment << 3; 670 - else 671 - fr_subtype = 0; 672 - 673 - frag_var (rs_cfa, 4, 0, fr_subtype, make_expr_symbol (exp), 674 + frag_var (rs_cfa, 4, 0, 1 << 3, make_expr_symbol (exp), 675 d->loc4_fix, (char *) d->loc4_frag); 676 return 1; 677 } 678 + else if ((exp->X_op == O_divide 679 + || exp->X_op == O_right_shift) 680 + && d->cie_info.code_alignment > 1) 681 + { 682 + if (exp->X_add_symbol->bsym 683 + && exp->X_op_symbol->bsym 684 + && exp->X_add_symbol->sy_value.X_op == O_subtract 685 + && exp->X_op_symbol->sy_value.X_op == O_constant 686 + && ((exp->X_op == O_divide 687 + ? exp->X_op_symbol->sy_value.X_add_number 688 + : (offsetT) 1 << exp->X_op_symbol->sy_value.X_add_number) 689 + == (offsetT) d->cie_info.code_alignment)) 690 + { 691 + /* This is a case we can optimize as well. The expression was 692 + not reduced, so we can not finish the optimization until the 693 + end of the assembly. We set up a variant frag which we 694 + handle later. */ 695 + frag_var (rs_cfa, 4, 0, d->cie_info.code_alignment << 3, 696 + make_expr_symbol (&exp->X_add_symbol->sy_value), 697 + d->loc4_fix, (char *) d->loc4_frag); 698 + return 1; 699 + } 700 + } 701 break; 702 703 case state_error: 704 @@ -459,7 +474,9 @@ 705 706 diff = resolve_symbol_value (frag->fr_symbol); 707 708 - if (ca > 0 && diff % ca == 0 && diff / ca < 0x40) 709 + assert (ca > 0); 710 + diff /= ca; 711 + if (diff < 0x40) 712 ret = 0; 713 else if (diff < 0x100) 714 ret = 1; 715 @@ -496,21 +513,21 @@ 716 { 717 offsetT diff; 718 fragS *loc4_frag; 719 - int loc4_fix; 720 + int loc4_fix, ca; 721 722 loc4_frag = (fragS *) frag->fr_opcode; 723 loc4_fix = (int) frag->fr_offset; 724 725 diff = resolve_symbol_value (frag->fr_symbol); 726 727 + ca = frag->fr_subtype >> 3; 728 + assert (ca > 0); 729 + diff /= ca; 730 switch (frag->fr_subtype & 7) 731 { 732 case 0: 733 - { 734 - int ca = frag->fr_subtype >> 3; 735 - assert (ca > 0 && diff % ca == 0 && diff / ca < 0x40); 736 - loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | (diff / ca); 737 - } 738 + assert (diff < 0x40); 739 + loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | diff; 740 break; 741 742 case 1: 743 diff -Naur binutils-2.19.orig/gas/Makefile.am binutils-2.19/gas/Makefile.am 744 --- binutils-2.19.orig/gas/Makefile.am 2008-10-02 01:07:17.000000000 -0700 745 +++ binutils-2.19/gas/Makefile.am 2009-01-14 01:00:24.000000000 -0800 746 @@ -2159,7 +2159,8 @@ 747 dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ 748 subsegs.h $(INCDIR)/obstack.h 749 ecoff.o: ecoff.c ecoff.h 750 -ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h 751 +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h \ 752 + struc-symbol.h 753 expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h 754 flonum-copy.o: flonum-copy.c 755 flonum-konst.o: flonum-konst.c 756 diff -Naur binutils-2.19.orig/gas/Makefile.in binutils-2.19/gas/Makefile.in 757 --- binutils-2.19.orig/gas/Makefile.in 2008-10-02 01:07:17.000000000 -0700 758 +++ binutils-2.19/gas/Makefile.in 2009-01-14 01:00:24.000000000 -0800 759 @@ -3002,7 +3002,8 @@ 760 dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ 761 subsegs.h $(INCDIR)/obstack.h 762 ecoff.o: ecoff.c ecoff.h 763 -ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h 764 +ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h \ 765 + struc-symbol.h 766 expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h 767 flonum-copy.o: flonum-copy.c 768 flonum-konst.o: flonum-konst.c 536 769 diff -Naur binutils-2.19.orig/gas/testsuite/ChangeLog binutils-2.19/gas/testsuite/ChangeLog 537 770 --- binutils-2.19.orig/gas/testsuite/ChangeLog 2008-09-17 02:00:45.000000000 -0700 … … 547 780 548 781 * gas/all/gas.exp: Don't run redef tests on a bunch of targets. 549 diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips.exp binutils-2.19/gas/testsuite/gas/mips/mips.exp550 --- binutils-2.19.orig/gas/testsuite/gas/mips/mips.exp 2008-09-06 01:47:00.000000000 -0700551 +++ binutils-2.19/gas/testsuite/gas/mips/mips.exp 2009-01-08 16:16:12.000000000 -0800552 @@ -398,6 +398,9 @@553 run_dump_test_arches "abs" [mips_arch_list_matching mips1]554 run_dump_test_arches "add" [mips_arch_list_matching mips1]555 run_dump_test_arches "and" [mips_arch_list_matching mips1]556 + run_dump_test_arches "mips1-fp" [mips_arch_list_matching mips1]557 + run_list_test_arches "mips1-fp" "-32 -msoft-float" \558 + [mips_arch_list_matching mips1]559 run_dump_test "break20"560 run_dump_test "trap20"561 562 782 diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.d binutils-2.19/gas/testsuite/gas/mips/mips1-fp.d 563 783 --- binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.d 1969-12-31 16:00:00.000000000 -0800 … … 594 814 + add.s $f0,$f2,$f4 595 815 + cfc1 $2,$0 816 diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips.exp binutils-2.19/gas/testsuite/gas/mips/mips.exp 817 --- binutils-2.19.orig/gas/testsuite/gas/mips/mips.exp 2008-09-06 01:47:00.000000000 -0700 818 +++ binutils-2.19/gas/testsuite/gas/mips/mips.exp 2009-01-08 16:16:12.000000000 -0800 819 @@ -398,6 +398,9 @@ 820 run_dump_test_arches "abs" [mips_arch_list_matching mips1] 821 run_dump_test_arches "add" [mips_arch_list_matching mips1] 822 run_dump_test_arches "and" [mips_arch_list_matching mips1] 823 + run_dump_test_arches "mips1-fp" [mips_arch_list_matching mips1] 824 + run_list_test_arches "mips1-fp" "-32 -msoft-float" \ 825 + [mips_arch_list_matching mips1] 826 run_dump_test "break20" 827 run_dump_test "trap20" 828 596 829 diff -Naur binutils-2.19.orig/ld/ChangeLog binutils-2.19/ld/ChangeLog 597 830 --- binutils-2.19.orig/ld/ChangeLog 2008-10-09 05:18:31.000000000 -0700 … … 2399 2632 afptr++; 2400 2633 } 2634 diff -Naur binutils-2.19.orig/ld/testsuite/ChangeLog binutils-2.19/ld/testsuite/ChangeLog 2635 --- binutils-2.19.orig/ld/testsuite/ChangeLog 2008-10-02 03:08:04.000000000 -0700 2636 +++ binutils-2.19/ld/testsuite/ChangeLog 2009-01-14 01:13:49.000000000 -0800 2637 @@ -1,3 +1,8 @@ 2638 +2009-01-14 Joseph Myers <joseph@codesourcery.com> 2639 + 2640 + * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New. 2641 + * ld-arm/arm-elf.exp: Run thumb2-bl-undefweak test. 2642 + 2643 2008-09-30 Alan Modra <amodra@bigpond.net.au> 2644 2645 * ld-elf/extract-symbol-1sec.d: Correct section lma. 2646 diff -Naur binutils-2.19.orig/ld/testsuite/ld-arm/arm-elf.exp binutils-2.19/ld/testsuite/ld-arm/arm-elf.exp 2647 --- binutils-2.19.orig/ld/testsuite/ld-arm/arm-elf.exp 2008-08-26 04:46:41.000000000 -0700 2648 +++ binutils-2.19/ld/testsuite/ld-arm/arm-elf.exp 2009-01-14 01:13:49.000000000 -0800 2649 @@ -184,6 +184,7 @@ 2650 run_dump_test "group-relocs-ldr-bad" 2651 run_dump_test "group-relocs-ldrs-bad" 2652 run_dump_test "group-relocs-ldc-bad" 2653 +run_dump_test "thumb2-bl-undefweak" 2654 run_dump_test "emit-relocs1" 2655 2656 # Exclude non-ARM-EABI targets. 2401 2657 diff -Naur binutils-2.19.orig/opcodes/ChangeLog binutils-2.19/opcodes/ChangeLog 2402 2658 --- binutils-2.19.orig/opcodes/ChangeLog 2008-10-02 01:07:19.000000000 -0700
Note:
See TracChangeset
for help on using the changeset viewer.