Skip to content

Commit

Permalink
Use the biggest adjustment
Browse files Browse the repository at this point in the history
Replace GOT symbols with ABSOLUTE
  • Loading branch information
eukarpov committed Jul 30, 2024
1 parent 2335502 commit b20dbe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions gcc/config/aarch64/aarch64-coff.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@

#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGNMENT) \
{ \
unsigned HOST_WIDE_INT rounded = SIZE; \
if (SIZE == 0) \
rounded = 1; \
rounded += (ALIGNMENT / BITS_PER_UNIT) - 1; \
rounded = (rounded / (ALIGNMENT / BITS_PER_UNIT) \
* ((ALIGNMENT) / BITS_PER_UNIT)); \
unsigned HOST_WIDE_INT rounded = MAX((SIZE), 1); \
unsigned HOST_WIDE_INT alignment = MAX((ALIGNMENT), BIGGEST_ALIGNMENT); \
rounded += (alignment / BITS_PER_UNIT) - 1; \
rounded = (rounded / (alignment / BITS_PER_UNIT) \
* (alignment / BITS_PER_UNIT)); \
ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, rounded); \
}

Expand Down
2 changes: 1 addition & 1 deletion gcc/config/aarch64/aarch64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20997,7 +20997,7 @@ aarch64_classify_symbol (rtx x, HOST_WIDE_INT offset)
if ((flag_pic || SYMBOL_REF_WEAK (x))
&& !aarch64_symbol_binds_local_p (x))
return aarch64_cmodel == AARCH64_CMODEL_SMALL_SPIC
? SYMBOL_SMALL_GOT_28K : SYMBOL_SMALL_GOT_4G;
? SYMBOL_SMALL_ABSOLUTE : SYMBOL_SMALL_ABSOLUTE;

/* Same reasoning as the tiny code model, but the offset cap here is
1MB, allowing +/-3.9GB for the offset to the symbol. */
Expand Down

0 comments on commit b20dbe2

Please sign in to comment.