Files
Senthil Kumar Selvaraj b660e9eb7a Fix PR21404 - assertion fail when calculating symbol size
Fix a host of problems related to adjustment of
symbol values and sizes when relaxing for avr.

1. Adjust symbol size first before adjusting symbol
value. Otherwise, a symbol whose value just got adjusted to the
relaxed address also ends up getting resized. See pr21404-1.s.

2. Reduce symbol sizes only if their span is below an
alignment boundary. Otherwise, the size gets decremented once when the
actual instruction is relaxed and padding bytes are added, and again
when the padding bytes are deleted (if padding ends up being unnecessary).
pr21404-2.s addresses that, and this bug is really the root cause of PR21404.

3. Adjust all symbol values before an alignment boundary.
Previous code did not adjust symbol values if they fell in the
would-be padded area, resulting in incorrect symbol values in some
cases (see pr21404-3.s).

4. Increase symbol sizes if alignment directives require so.
As pr21404-4.s shows
.global nonzero_sym
L1:
    jmp  L1
nonzero_sym:
    nop
    nop
    .p2align 2
.size nonzero_sym, .-nonzero_sym

The two nops satisfy the 4 byte alignment at assembly time and
therefore the size of nonzero_sym is 4. Relaxation shortens
the 4 byte jmp to a 2 byte rjmp, and to satisfy 4 byte alignment
the code places 2 extra padding bytes after the nops, increasing
nonzero_sym's size by 2. This wasn't handled before.

If the assembly code does not have any align directives, then the
boundary is the section size, and symbol values and sizes == boundary
should also get adjusted. To handle that case, add a did_pad variable
and use that to determine whether it should use < boundary or <= boundary.

Also get rid of reloc_toaddr, which is now redundant.  toaddr is now not
adjusted to handle the above case - the newly added
did_pad variable does the job.

pr21404-{5,6,7,8} are the same testcases written for local symbols, as
the code handles them slightly differently.
2017-05-04 10:34:29 +05:30
..
2017-04-07 00:17:09 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-02-17 01:26:12 +00:00
2017-04-13 17:07:24 +09:30
2017-02-17 01:26:12 +00:00
2017-04-13 17:07:24 +09:30
2017-02-17 01:26:12 +00:00
2015-08-12 04:32:43 -07:00
2016-01-01 22:59:17 +10:30
2017-01-02 13:55:05 +10:30
2015-08-12 04:32:43 -07:00
2015-08-12 04:32:43 -07:00
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:25 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:25 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:25 +09:30
2017-02-28 13:20:21 +10:30
2017-04-27 11:54:29 +09:30
2017-04-13 17:07:24 +09:30
2017-02-21 11:49:37 +10:30
2017-04-13 17:07:25 +09:30
2017-04-27 11:54:29 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:25 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-02-17 01:26:12 +00:00
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-13 17:07:24 +09:30
2017-04-19 20:39:53 +09:30
2017-02-17 01:26:12 +00:00
2017-05-04 00:00:55 +00:00
2016-12-23 09:50:53 +01:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

BFD is an object file library.  It permits applications to use the
same routines to process object files regardless of their format.

BFD is used by the GNU debugger, assembler, linker, and the binary
utilities.

The documentation on using BFD is scanty and may be occasionally
incorrect.  Pointers to documentation problems, or an entirely
rewritten manual, would be appreciated.

There is some BFD internals documentation in doc/bfdint.texi which may
help programmers who want to modify BFD.

BFD is normally built as part of another package.  See the build
instructions for that package, probably in a README file in the
appropriate directory.

BFD supports the following configure options:

  --target=TARGET
	The default target for which to build the library.  TARGET is
	a configuration target triplet, such as sparc-sun-solaris.
  --enable-targets=TARGET,TARGET,TARGET...
	Additional targets the library should support.  To include
	support for all known targets, use --enable-targets=all.
  --enable-64-bit-bfd
	Include support for 64 bit targets.  This is automatically
	turned on if you explicitly request a 64 bit target, but not
	for --enable-targets=all.  This requires a compiler with a 64
	bit integer type, such as gcc.
  --enable-shared
	Build BFD as a shared library.
  --with-mmap
	Use mmap when accessing files.  This is faster on some hosts,
	but slower on others.  It may not work on all hosts.

Report bugs with BFD to bug-binutils@gnu.org.

Patches are encouraged.  When sending patches, always send the output
of diff -u or diff -c from the original file to the new file.  Do not
send default diff output.  Do not make the diff from the new file to
the original file.  Remember that any patch must not break other
systems.  Remember that BFD must support cross compilation from any
host to any target, so patches which use ``#ifdef HOST'' are not
acceptable.  Please also read the ``Reporting Bugs'' section of the
gcc manual.

Bug reports without patches will be remembered, but they may never get
fixed until somebody volunteers to fix them.

Copyright (C) 2012-2017 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.