aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2012-11-04 00:40:05 +0100
committerThomas Preud'homme <robotux@celest.fr>2012-11-17 10:01:11 +0100
commite2212738d40877a8a54e5728999acb7f035f66f3 (patch)
tree5f7489dc5aa639ecdbd707a1b7a479a6c9b9da44 /tcc.h
parentab24aaeca303abadd987c2a4ab3a56efe755c37c (diff)
downloadtinycc-e2212738d40877a8a54e5728999acb7f035f66f3.tar.gz
tinycc-e2212738d40877a8a54e5728999acb7f035f66f3.tar.bz2
Generate PLT thumb stub only when necessary
Generate PLT thumb stub for an ARM PLT entry only when at least one Thumb instruction branches to that entry. This is a rewrite of the previous patch.
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/tcc.h b/tcc.h
index 4e88782..9e7c574 100644
--- a/tcc.h
+++ b/tcc.h
@@ -492,6 +492,13 @@ typedef struct ASMOperand {
} ASMOperand;
#endif
+struct sym_attr {
+ unsigned long got_offset;
+#ifdef TCC_TARGET_ARM
+ unsigned char plt_thumb_stub:1;
+#endif
+};
+
struct TCCState {
unsigned output_type : 8;
unsigned reloc_output : 1;
@@ -524,11 +531,11 @@ struct TCCState {
Section **priv_sections;
int nb_priv_sections; /* number of private sections */
- /* got handling */
+ /* got & plt handling */
Section *got;
Section *plt;
- unsigned long *got_offsets;
- int nb_got_offsets;
+ struct sym_attr *sym_attrs;
+ int nb_sym_attrs;
/* give the correspondance from symtab indexes to dynsym indexes */
int *symtab_to_dynsym;