Fix problem with large section size.

In tcc_load_object_file use unsigned long for size/offset.
This avoids strange sizes of sections in case of overflow.
The sections that are now larger then 4G may not work.
This avoids a hang on macos in realloc.
This commit is contained in:
herman ten brugge 2022-12-27 07:45:38 +01:00
parent 676755f6ee
commit d1fa89a11f

View file

@ -3002,7 +3002,8 @@ ST_FUNC int tcc_load_object_file(TCCState *s1,
{
ElfW(Ehdr) ehdr;
ElfW(Shdr) *shdr, *sh;
int size, i, j, offset, offseti, nb_syms, sym_index, ret, seencompressed;
unsigned long size, offset, offseti;
int i, j, nb_syms, sym_index, ret, seencompressed;
char *strsec, *strtab;
int stab_index, stabstr_index;
int *old_to_new_syms;