History

Avoid Invalid relocation and section conflict on bsd.

With recent changes I got: /usr/lib/crtbegin.o: error: Invalid relocation entry [ 2] '.rela.text' @ 0000007a And: libtcc.o: error: section type conflict: .eh_frame 01 <> 70000001

herman ten brugge committed 1 year ago

Commit 68c8c351 parent d440ed81 file · +6 −1Browse files

Unified · Split

tccelf.c+6−1
@@ -3169,9 +3169,11 @@ invalid: · 3168 unmodified lines
31693169 || 0 == strncmp(sh_name, ".stab", 5)) {
31703170 if (!s1->do_debug || seencompressed)
31713171 continue;
3172+#if !(TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD)
31723173 } else if (0 == strncmp(sh_name, ".eh_frame", 9)) {
31733174 if (NULL == eh_frame_section)
31743175 continue;
3176+#endif
31753177 } else
31763178 if (sh->sh_type != SHT_PROGBITS &&
31773179 sh->sh_type != SHT_NOTE &&
@@ -3181,6 +3183,9 @@ invalid: · 3 unmodified lines
31813183 sh->sh_type != SHT_FINI_ARRAY
31823184 #ifdef TCC_ARM_EABI
31833185 && sh->sh_type != SHT_ARM_EXIDX
3186+#endif
3187+#if TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD
3188+ && sh->sh_type != SHT_X86_64_UNWIND
31843189 #endif
31853190 )
31863191 continue;
@@ -3195,7 +3200,7 @@ invalid: · 8 unmodified lines
31953200 if (strcmp(s->name, sh_name))
31963201 continue;
31973202 if (sh->sh_type != s->sh_type
3198− && s != eh_frame_section
3203+ && strcmp (s->name, ".eh_frame")
31993204 ) {
32003205 tcc_error_noabort("section type conflict: %s %02x <> %02x", s->name, sh->sh_type, s->sh_type);
32013206 goto the_end;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t