mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 04:49:54 +08:00
* xcofflink.c (xcoff_link_input_bfd): Check for TOC overflow.
This commit is contained in:
@ -12,6 +12,8 @@ Wed Apr 17 12:08:24 1996 Michael Meissner <meissner@tiktok.cygnus.com>
|
|||||||
|
|
||||||
Wed Apr 17 13:07:37 1996 Ian Lance Taylor <ian@cygnus.com>
|
Wed Apr 17 13:07:37 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* xcofflink.c (xcoff_link_input_bfd): Check for TOC overflow.
|
||||||
|
|
||||||
* linker.c (_bfd_generic_link_add_one_symbol): When calling the
|
* linker.c (_bfd_generic_link_add_one_symbol): When calling the
|
||||||
callback routines, pass h->root.string rather than name, in case
|
callback routines, pass h->root.string rather than name, in case
|
||||||
copy is true and name is transient.
|
copy is true and name is transient.
|
||||||
|
@ -3989,11 +3989,20 @@ xcoff_link_input_bfd (finfo, input_bfd)
|
|||||||
of the TOC using a 16 bit offset from tocval. This
|
of the TOC using a 16 bit offset from tocval. This
|
||||||
test assumes that the TOC comes at the end of the
|
test assumes that the TOC comes at the end of the
|
||||||
output section, as it does in the default linker
|
output section, as it does in the default linker
|
||||||
script. If the TOC anchor is too far into the .toc
|
script. */
|
||||||
section, the relocation routine will report
|
|
||||||
overflows. */
|
|
||||||
tocend = ((*csectpp)->output_section->vma
|
tocend = ((*csectpp)->output_section->vma
|
||||||
+ (*csectpp)->output_section->_raw_size);
|
+ (*csectpp)->output_section->_raw_size);
|
||||||
|
|
||||||
|
if (tocval + 0x10000 < tocend)
|
||||||
|
{
|
||||||
|
(*_bfd_error_handler)
|
||||||
|
("TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling",
|
||||||
|
(unsigned long) (tocend - tocval));
|
||||||
|
bfd_set_error (bfd_error_file_too_big);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (tocval + 0x8000 < tocend)
|
if (tocval + 0x8000 < tocend)
|
||||||
{
|
{
|
||||||
bfd_vma tocadd;
|
bfd_vma tocadd;
|
||||||
|
Reference in New Issue
Block a user