Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal error, aborting at /binutils/bfd/amigaoslink.c line 569 in get_relocated_section_contents #13

Closed
mheyer32 opened this issue Mar 16, 2018 · 7 comments

Comments

@mheyer32
Copy link
Contributor

https://github.com/mheyer32/DoomAttack

When linking this project, one of the recent changes to binutils is now causing the issue below.

I wanted to file against the binutils project, but there seems to be no way to report issues(?)

/home/matze/amigatoolchain/amiga-gcc-out/bin/m68k-amigaos-gcc -noixemul -DUSENOIXEMUL -m68030 -m68881 -DNOFBASEREL -Ofast -fstrength-reduce -fomit-frame-pointer -Werror -Wimplicit -Wstrict-prototypes -include "doomdef.h" -DNDEBUG -D__BIG_ENDIAN__ -DNORMALUNIX -DAMIGA am_map.o am_mapamiga.o analogjoy.o clip.o d_items.o d_locale.o d_main.o d_net.o doomdef.o doomstat.o dstrings.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o i_main.o i_net.o i_sound.o i_system.o i_systemmisc.o i_video.o info.o m_argv.o m_bbox.o m_cheat.o m_fixed.o m_fixedamiga.o m_menu.o m_misc.o m_random.o m_swap.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_engine.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o s_sound.o sounds.o st_lib.o st_stuff.o tables.o v_video.o w_wad.o wi_stuff.o z_zone.o \
-lsocket -o /home/matze/doomattack_git/gnudoom/bin/DoomAttack
/home/matze/doomattack_git/gnudoom/bin/DoomAttack: code reloc for _AM_drawFline is out of range: 00000000
/home/matze/amigatoolchain/amiga-gcc-out/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: BFD 2.14b 20180118 (adtools build 20080628) internal error, aborting at /home/matze/amigatoolchain/amiga-gcc/projects/binutils/bfd/amigaoslink.c line 569 in get_relocated_section_contents

/home/matze/amigatoolchain/amiga-gcc-out/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: Please report this bug.
@mheyer32
Copy link
Contributor Author

Removing am_mapamiga.s from the code and just replacing it with the c function in am_map.c didn't help and just shifted the problem somewhere else.

Be aware, DoomAttack is not compiled with -fbaserel (much of it is implemented in assembly and all of them use absolute symbol references)

@bebbo
Copy link
Owner

bebbo commented Mar 16, 2018

well, the binutils linker wants all code sections named .text

@mheyer32
Copy link
Contributor Author

Confirmed. I moved all assembly files' section directives to .text and it passed the linking stage. But I could swear it already linked before that.

On a sidenote, would it be possible to allow sections with non-gcc names? It would relieve some of the linker pressure to stuff everything together in -msmall-code and -fbaserel modes. The programmer had more control over which code/data needs to go together and which code can be in separate sections (via long jumps). Obviously I didn't think this through yet, but sounds desirable.

@bebbo
Copy link
Owner

bebbo commented Mar 21, 2018

I just reactivated the amiga hunk format. The aout format only supports 2 real sections, one .text and one .data section. Even the .bss is in fact only an extension to .data.

With amiga hunk format an unlimited count of sections should work with one limitation: Only one baserel .data section is allowed.

@bebbo bebbo reopened this Mar 21, 2018
@mheyer32
Copy link
Contributor Author

Is there anything you ask me to test?

@bebbo
Copy link
Owner

bebbo commented Mar 21, 2018

I am trying to create a minimal problem...
... not enough time this week.

@bebbo
Copy link
Owner

bebbo commented Mar 28, 2018

Ha, it's not a binutil issue, it's section naming issue:

the instruction is:

	jra _AM_drawFline 

pc relative jumps between different sections are impossible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants