Skip to content

JUMP cannot reach address beyond 1FF (2047) #16

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

Open
3615JMD opened this issue Feb 5, 2020 · 0 comments
Open

JUMP cannot reach address beyond 1FF (2047) #16

3615JMD opened this issue Feb 5, 2020 · 0 comments

Comments

@3615JMD
Copy link

3615JMD commented Feb 5, 2020

Hi
Of course this issue appears only on large assembly programs
A JUMP instruction with absolute adress beyond 01FF will generate this error:

Error: rel too far BFD_RELOC_16

I beleive i have found the issue in file ....\gas\config\tc-esp32s2ulp.c line 115:

case BFD_RELOC_ESP32S2ULP_16_IMM:
	if (fixP->fx_addsy != NULL)// relocation will be done not in linker
	{
		asymbol *sym = symbol_get_bfdsym(fixP->fx_addsy);
		int force_reloc = S_FORCE_RELOC(fixP->fx_addsy, 1);
		//printf("force_reloc = %i \n", force_reloc);
		if (force_reloc != 0) if (sym->section->flags != 0) value = value >> 2;
	}
	if ((value < 0) || (value > 2047))		// <<<<<<<<<<<<<<<<<<<<<<<< HERE ! 
		as_bad_where(fixP->fx_file, fixP->fx_line, _("rel too far BFD_RELOC_16"));

if (value > 2047) it generates an error. the value should'nt it be 8191 instead ?

best regards,
Jean Marc

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

1 participant