This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Move non-PIC jump table to rodata on 32-bit linux


The attached patch fixes a problem noted by Helge Deller.  When a non-PIC jump table is placed in the text section, the local label marking the head of the table ends up in the unwind data.  This is due to the R_PARISC_DIR21L and R_PARISC_DIR14R relocations needed
to load the address of the table.  This breaks the unwind data.

On the 32-bit Linux target, we can simply put non-PIC jump tables in rodata.  This has the added benefit that it shortens the text section and avoids potential issues in calculating
branch distances.

We should also do this for the HP-UX SOM target.  However, this requires deferring the output
of branch tables to final.

When generating PIC code, the references are relative and the label is removed by the assembler.

Tested change on hppa-unknown-linux-gnu.  Committed change to active branches.

Dave

--
John David Anglin  dave.anglin@bell.net

Attachment: jump-table-5.d
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]