Skip to content

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

@3615JMD

Description

@3615JMD

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions